你好,歡迎來到IOS教程網

 Ios教程網 >> IOS編程開發 >> IOS開發綜合 >> iphone開發:取音樂列表

iphone開發:取音樂列表

編輯:IOS開發綜合

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];
        } 
    }

 

 


摘自 雲懷空-abel

  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved