i am trying to store multiple song in mpplayer that are being fetch from database having song persistent id..but only single song is being added .here is what i am doing
MPMediaQuery *query = [MPMediaQuery songsQuery开发者_JAVA百科]; MPMediaPropertyPredicate *predicate = [MPMediaPropertyPredicate predicateWithValue:persistentId forProperty:MPMediaItemPropertyPersistentID]; [query addFilterPredicate:predicate]; NSArray *mediaItems = [query items]; //this array will consist of song with given persistentId. add it to collection and play it MPMediaItemCollection *col = [[MPMediaItemCollection alloc] initWithItems:mediaItems]; ///.... [col release];
thanks in advance
Regards devon smith
Are you sure that the PersistentID represents more that 1 track? I use a Persistent ID for each separate track in the album.
精彩评论