tags:

views:

210

answers:

2

Hi stackoverflow! I'm writing an iPhone application where I am looking to pull batches of, say, 10-20 random tracks via an MPMediaQuery, since performing a query for all tracks and selecting random tracks from that query results in an inordinate delay on launch. If a query for a few random tracks is not possible, is there a clever workaround?

Thanks!

+1  A: 

Could you move the selection of tracks to a different thread so that your UI can still appear?

Also, what code are you using to select the random tracks? It seems like this should occur very quickly, even with thousands of songs.

jessecurry
The problem is an MPMediaQuery takes a good amount of time to return.
refulgentis
A: 

I've been working with MediaPlayer.framework since June, and honestly there isn't a way as far as I can tell. I'm extensively rewriting a fairly popular app I have on the App Store to use Core Data for caching just because anything with MediaPlayer.framework takes forever because all you're really doing is forwarding invocations to the MobileMediaPlayer (iPod app).

refulgentis