IT学习联盟

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
IT学习联盟 门户 文章 iphone/ipad 查看内容

iphone开发:取音乐列表

2012-8-17 22:42| 发布者: admin| 查看: 911| 评论: 0

MPMediaQuery *myPlaylistsQuery = [MPMediaQuery songsQuery]; 
    NSArray *playlists = [myPlaylistsQuery collections]; 
   
    for (MPMediaPlaylist *playlist in playlists) { 
       
        NSArray *songs = [playlist items]; 
        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];
        } 
    }

Archiver|IT学习联盟| 网站地图

Powered by Discuz! X2.5© 2001-2010 世界学习室 大伟制作

GMT+8, 2018-5-26 00:30 , Processed in 0.082998 second(s), 12 queries .