How i can get list of user playlists from code? In CocoaTouch.
+3
A:
This is solution:
MPMediaQuery *playlistsQuery = [MPMediaQuery playlistsQuery];
NSArray *playlists = [playlistsQuery collections];
:)
Sergey Zenchenko
2010-01-07 11:51:30
A:
MPMediaQuery *myPlaylistsQuery = [MPMediaQuery playlistsQuery];
NSArray *playlists = [myPlaylistsQuery collections];
for (MPMediaPlaylist *playlist in playlists) { NSLog (@"%@", [playlist valueForProperty: MPMediaPlaylistPropertyName]); NSArray *songs = [playlist items]; for (MPMediaItem *song in songs) { NSString *songTitle = [song valueForProperty: MPMediaItemPropertyTitle]; NSLog (@"\t\t%@", songTitle); } }
www.ruu.cc
2010-10-19 09:09:23