Quote:
Originally Posted by cpprulez
Thank you, Robert 
I thought of that too, but I'm afraid it won't work, because the persistent id of a song is of type Int64 
|
You should build an MPMediaCollection, then count how many there are.
Next, generate a random number and use the count to limit the maximum random number.
Finally, call the item from the collection at that index. It's almost instantaneous.