Determine if a song has album art in iOS

Viewed 337

I am working on an iOS app and I need to determine if a song has album art. I am using the MPMusicPlayerController to access the native iOS music library and I am using a MPMediaItemArtwork to capture the artwork sent from the iOS music library. This is the coding I use to get the artwork:

MPMediaItemArtwork *mpArt = [mpSong valueForProperty:MPMediaItemPropertyArtwork];

To test if artwork is present I use this:

if (mpArt)
{
    imgArt = [mpArt imageWithSize:CGSizeMake(250, 250)];
}
else
{
    imgArt = [UIImage imageNamed:@"Alternative_Artwork_Image.jpg"];
}

No matter what the song's artwork is, the result is always true.

Any help would be appreciated. Thank you in advance.

1 Answers
Related