iphone開發:取音樂列表iPhone軟體開發教學課程

MPMediaQuery *myPlaylistsQuery = [MPMediaQuery songsQuery]; 
    NSArray *playlists = [myPlaylistsQuery collections]; 
   
    for (MPMediaPlaylist *playlist in playlists) { 
       
        NSArray *songs = ; 
        for (MPMediaItem *song in songs)

       { 
            Song *song1 = [[Song alloc] init];
            song1.songName = [song valueForProperty: MPMediaItemPropertyTitle];
            song1.singerName = [song valueForKey:MPMediaItemPropertyPodcastTitle];
            [self.mySongArray addObject:song1];
            //NSLog(@"song1.songName====%@",song1.songName);
            [song1 release];
        } 
    }

 

 

摘自 雲懷空-abel

You May Also Like