您可以使用该collectionSections属性MPMediaQuery来获取数据的相关部分。对于artistsQuery,title每个的MPMediaQuerySection代表艺术家姓名的第一个字母。每个部分还有一个range,然后您可以应用它从数组中获取艺术家姓名的子collections数组。
这将为您MPMediaQuerySection提供字母A:
MPMediaQuery *allArtistsQuery = [MPMediaQuery artistsQuery];
NSArray *collectionSections = allArtistsQuery.collectionSections;
NSPredicate *artistPredicate = [NSPredicate predicateWithFormat:@"title == %@", @"A"];
MPMediaQuerySection *artistSection = [[collectionSections filteredArrayUsingPredicate:artistPredicate] lastObject];
然后获取该部分的属性以获取以字母Arange开头的所有艺术家收藏的子数组:
NSArray *collections = allArtistsQuery.collections;
NSRange arraySlice = artistSection.range;
NSArray *filteredCollections = [collections subarrayWithRange:arraySlice];
for (MPMediaItemCollection *artistCollection in filteredCollections) {
    NSLog(@"%@", [[artistCollection representativeItem] valueForProperty:MPMediaItemPropertyArtist]);
}