iOS 4: FigCreateCGImageFromJPEG returned -1
I'm trying to get a basic image picker/photo taker running in my app and have run into the following error:
*** ERROR: FigCreateCGImageFromJPEG returned -1. Input (null) was 551120 bytes
I have the image picker showing, the camera view works fine.
When I take an image with the camera and select the 'use' button the error appears in the console and the app crashes.
The App works fine just for selecting an image from the album. I have looked at similar threads here and no solution seems to have been proposed.
Just wondering if anyone has come across anything helpful.
-(IBAction)getPhoto:(id)sender{
if((UIButton *) sender == sharePhoto) {
开发者_如何学PythonimagePicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
} else {
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
}
[self presentModalViewController:imagePicker animated:YES];
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[picker dismissModalViewControllerAnimated:YES];
imageView.image = [info objectForKey:@""];
}
I have managed to stop my application crashing but the error persist.
Instead of assigning the UIImage
from the NSDictionary *info
straight to my UIImageView
I retain it in a UIImage
variable then dismiss the ModalViewcontroller
.
In the viewWillAppear
method of the root UIViewController
I then assign the image to my UIImageView
.image.
I don't know if the order I was doing things was the root cause. The error still appears in the console however.
精彩评论