I started using MPMediaPickerController way back in IOS 4. For unknown reason my code now crashes when the user taps on the "album" tab bar button . Tapping on the "song" works as expected. My test device is configure to use iTunes match and iCloud and IOS 6.0.2. When it crashes I get the following message in my debug console. I do not use ARC
2012-12-31 10:53:26.847 MusicTrainerLite[1950:907] -[UIImage albumImageWithFormat:artworkCacheID:canUseSurfaceBackedImage:]: unrecognized selector sent to instance 0x1e59db10
2012-12-31 10:53:26.848 MusicTrainerLite[1950:907] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImage albumImageWithFormat:artworkCacheID:canUseSurfaceBackedImage:]: unrecognized selector sent to instance 0x1e59db10'
I have compared the sample app and its Xcode project settings to my app and can not figure out what the difference is?
The only difference I have found is the sample app does not set the deployment target. I set my mine to 4.3. (even when I do not set it I still crash). I also noticed in the source code they tweak the status bar.
// The media item picker uses the default UI style, so it needs a default-style
// status bar to match it visually
#warning clean up debug
UIStatusBarStyle statusBarStyle = [[UIApplication sharedApplication] statusBarStyle];
SCILog(@"statusBarStyle = %d", statusBarStyle);
[[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleDefault animated: YES];
[self presentModalViewController:mediaPicker animated:YES];
This did not resolve the problem.
I checked to make sure I am using the same frameworks as the addMusic sample app.
I also noticed that sample addMusic app lets users down load songs from the MPMediaPickerController.
I tried setting mediaPicker.showsCloudItems = YES;and NO; still crashes
The sample app sets [mediaPicker setAllowsPickingMultipleItems:YES]; I still crash no matter how this is set.
This is really really strange. I can not figure out what my bug is.
Any comments or suggestions would be greatly appreciated.