I am currently developing an app that shows what artist, track and album art you're listening to in the Music player. All is going well apart from when I play a song with no artwork I want to be able to show my own default image (as opposed to showing a blank screen).
The below is how I imagined it SHOULD work however it never gets into the else as the itemArtwork is never nil!
You're help is appreciated.
Thanks, Ben
_item = [_player nowPlayingItem];
MPMediaItemArtwork *itemArtwork = [_item valueForProperty:MPMediaItemPropertyArtwork];
if (itemArtwork != nil) {
UIImage *albumArtworkImage = [itemArtwork imageWithSize:CGSizeMake(250.0, 250.0)];
_albumArtImageView.image = albumArtworkImage;
} else { // no album artwork
NSLog(@"No ALBUM ARTWORK");
_albumArtImageView.image = [UIImage imageNamed:@"kol.jpg"];
}