I’m having a very odd problem that I can’t understand. I have created an iPhone only app and it works exactly how I want on the iPhone; however, crashes at one point over and over in the iPad. I’m adding a gift image to a dictionary using the following code:
[dictionary setObject:giftImage forKey:key];
On the iPhone this works fine; however, on the iPad it causes the following exception:
-[__NSCFDictionary setObject:forKey:]: attempt to insert nil value (key: A877373A-B588-4631-A850-06C2F23A45F7)
I cant understand why the image would be nil when using the iPad, but would be created properly on the iPhone.
Any help would be greatly appreciated!
EDIT:
I have done more testing and on the iPhone giftImage is given a value; however, on the iPad it is null, but I can not figure out why…
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *giftImage = [info objectForKey:UIImagePickerControllerOriginalImage];
Look at the other keys in the
infodictionary provided to your image picker delegate method and you might see why the image isn’t where you expect it to be.