Well, if you have the query, I'm assuming you already have a MPMediaItemCollection that you'd like to play. From there, you assign that collection as the player's queue, and a specific MPMediaItem from the collection as the player's now playing item. The collection declares an items
property that allows you to access the individual media items by index, which you can use to assign the now playing item. In this case 0
will play the first track in the collection, but this can be set to any index within the array's bounds.
MPMusicPlayerController *controller = [MPMusicPlayerController iPodMusicPlayer];
[controller setQueueWithItemCollection:myMediaItemCollection];
[controller setNowPlayingItem:myMediaItemCollection.items[0]];
[controller prepareToPlay];
[controller play];