I have the following code to get the UIImage from MPMediaItemPropertyArtWork to display the coverArt in my view. I get a non-NULL artwork from the mediaItem, however, when I try to extract the UIImage from the artwork, it returns NULL and I don't see anything in my UIImageView. Any help will be greatly appreciated.
CGSize artworkSize = CGSizeMake(30, 30);
UIImage *artworkImage;
MPMediaItemArtwork *artwork = [song valueForProperty: MPMediaItemPropertyArtwork];
if (artwork) {
NSLog(@"artwork available");
artworkImage = [artwork imageWithSize:artworkSize];
} else {
NSLog(@"artwork not available");
artworkImage = [UIImage imageNamed:@"EmptyAlbum.png"];
}
NSLog(@"artworkImage = %@", artworkImage);
coverArtView.image = artworkImage;