2012-12-01 4 views
0

버튼에서 iTunes Music Store에서 특정 트랙을 다운로드해야합니다. 내 앱에서 클릭하십시오. 나는 이것이 어떻게 수행 될 수 있는지 정확히 알 수는 없다.iTunes Store에서 특정 트랙을 다운로드하려면 어떻게해야합니까?

나는 재생 목록의 재생 목록과 노래를 가져 오기 위해 다음 코드를 구현 :

-(void)musicPlaylist{ 

    playlistQuery= [MPMediaQuery playlistsQuery]; 
    NSArray *arr = [playlistQuery collections]; 
    NSLog(@"Playlist is : %@",arr); 
    int count1=[arr count]; 
    NSLog(@" count 1 is %d",count1); 

    for (MPMediaPlaylist *playlist in arr) { 
     NSLog (@"%@", [playlist valueForProperty: MPMediaPlaylistPropertyName]); 
     playlistTitle = [playlist valueForProperty: MPMediaPlaylistPropertyName]; 
     playlistDict=[NSDictionary dictionaryWithObjectsAndKeys:playlistTitle,@"playlist Title",nil]; 
     [dictArray addObject:playlistDict]; 

     NSArray *songs = [playlist items]; 
     for (MPMediaItem *song in songs) { 
     NSString *songTitle =[song valueForProperty: MPMediaItemPropertyTitle]; 
     [songArray addObject:songTitle]; 
     } 
     NSLog(@"Playlist is %@",playlistTitle); 
     NSLog(@"Playlist Songs are %@",songArray); 
    } 
} 

는 지금 앱이 버튼 클릭의 특정 트랙을 다운로드 할 수 있도록합니다. 어떻게해야합니까?

+0

을 :

Making Store Purchases with the SKStoreProductViewController Class

이 도서관은 당신이 (ID를 얻기 위해) 아이튠즈 스토어에서 검색 할 수 있습니다 재생 목록 및 재생 목록의 노래를 가져 오는 코드 다음 코드 – Himanshu

+2

코드와 질문 사이의 연결은 무엇입니까? – miho

답변

관련 문제