The following code, is used to partition and add sections to a list of songs.
query = [MPMediaQuery songsQuery];
[query addFilterPredicate: artistNamePredicate];
NSArray *itemsFromArtistQuery = [query items];
self.artist1 = [self partitionObjects:itemsFromArtistQuery collationStringSelector:@selector(title)];
Works perfectly. However when I try to do it with:
query = [MPMediaQuery albumsQuery]; //same with playlistsQuery, artistsQuery, genresQuery
[query addFilterPredicate: artistNamePredicate];
NSArray *itemsFromArtistQuery = [query collections];
self.artist1 = [self partitionObjects:itemsFromArtistQuery collationStringSelector:@selector(title)];
I get a SIGABRT error every single time. I've attributed it to the "collections" part of the code, as that's the only difference in the whole block. I've tried changing "title" to "name" "albumTitle", "playlist", "genre" and more, but I still end up with:
"-[MPConcreteMediaItemCollection title]: unrecognized selector sent to instance"
Can anybody help me here? I'm ready to rip my hair out!
THANK-YOU!
BenBen