I'm developing a iOS media Player using the iPodMusicPlayer. I have a UITableView
with the MPMediaPickerController
selector.
After buying a song from the iTunes store, the picked track has no artwork in the iPodMusicPlayer:
MPMediaPlayer* player = [MPMediaPlayer iPodMusicPlayer];
MPMediaItem*item = [player nowPlayingItem];
MPMediaItemArtwork *artwork = [item valueForProperty:MPMediaItemPropertyArtwork];
UIImage *albumCoverArt = [artwork imageWithSize:CGSizeMake(100.0f, 100.0f)];
if(albumCoverArt!=nil) {
// do something
}
else {
// nil before sync
}
After syncing with iTunes the song reveals the artwork.
Since before syncing, the iPod player shows the artwork, I think I'm missing something in the code when requesting the item to the MPMediaLibrary
.
Any idea?