如何使用本地化字符串名称作为播放列表名称来获取“Purchased”和“Purchased on my iPhone”MPMediaPlaylist:
NSArray *songs;
NSString *name=@"Purchased";
// @TODO
// need to get localized version of this default iOS playlist name
//
MPMediaQuery *myPlaylistsQuery = [MPMediaQuery playlistsQuery];
NSArray *playlists = [myPlaylistsQuery collections];
NSArray *songs=nil;
for (MPMediaPlaylist *playlist in playlists) {
if( [name isEqualToString:[playlist valueForProperty: MPMediaPlaylistPropertyName]] ) {
songs = [playlist items];
break;
}
}