Add the MediaPlayer.Framework to your project
#import <MediaPlayer/MPMediaQuery.h>
#import <MediaPlayer/MPMediaPlaylist.h>
//----- LIST ALL PLAYLISTS -----
MPMediaQuery *myPlaylistsQuery = [MPMediaQuery playlistsQuery];
NSArray *playlists = [myPlaylistsQuery collections];
for (MPMediaPlaylist *playlist in playlists)
{
NSLog (@"%@", );
NSLog (@"%@", );
NSArray *songs = ;
for (MPMediaItem *song in songs)
{
NSString *songTitle = [song valueForProperty: MPMediaItemPropertyTitle];
NSLog (@"\t\t%@", songTitle);
NSLog (@"\t\t\t%@", [song valueForProperty: MPMediaItemPropertyPersistentID]);
}
}
Testing Attributes
NSLog(@"%d", [ integerValue]);
NSString *CellMainLabel;
CellMainLabel = ;
if ([ integerValue] & MPMediaPlaylistAttributeOnTheGo)
CellMainLabel = [CellMainLabel stringByAppendingString:@" -OTG"];
if ([ integerValue] & MPMediaPlaylistAttributeSmart)
CellMainLabel = [CellMainLabel stringByAppendingString:@" -SMART"];
if ([ integerValue] & MPMediaPlaylistAttributeGenius)
CellMainLabel = [CellMainLabel stringByAppendingString:@" -GENIUS"];