- -(NSArray*) findArtistList {
- NSMutableArray *artistList = [[NSMutableArray alloc]init];
- MPMediaQuery *listQuery = [MPMediaQuery playlistsQuery];
- NSArray *playlist = [listQuery collections];
- for (MPMediaPlaylist * list in playlist) {
- NSArray *songs = [list items];
- for (MPMediaItem *song in songs) {
- NSString *title =[song valueForProperty:MPMediaItemPropertyTitle];
-
- NSString *artist =[[song valueForProperty:MPMediaItemPropertyArtist] uppercaseString];
- if(artist!=nil&&![artistList containsObject:artist]){
- [artistList addObject:artist];
- }
- }
- }
- return artistList;
- }
posted @
2015-12-17 13:41
brave-sailor
阅读(
1534)
评论()
编辑
收藏
举报