I try to get the list of genres on my iPhone 5S with iOS 7.0.3 using this code:
MPMediaQuery *query = [MPMediaQuery genresQuery];
for (MPMediaItemCollection *item in [query collections]) {
NSLog(@"%@", [[item representativeItem] valueForProperty: MPMediaItemPropertyGenrePersistentID]);
NSLog(@"%@", [[item representativeItem] valueForProperty: MPMediaItemPropertyGenre]);
}
The problem is, that this code get the correct count of genres, but not the correct names. Some of the names and id's are show twice and some others are missing.
The code works fine on an iPod with iOS 6.1.3.
Anybody with an tipp for me?
Thanks, Stefan