ios4.1中发生错误(***错误:FigCreateCGImageFromJPEG返回-12905。输入(null)为499992字节。)!

时间:2010-10-26 07:59:00

标签: iphone objective-c ios4 uiimagepickercontroller

*** ERROR: FigCreateCGImageFromJPEG returned -12905. Input (null) was 499992 bytes.

每当我使用UIImagePicker时,我都会在ios4.1中出现错误[刚拍完之后]。我的代码很简单

UIImagePickerController *c = [[UIImagePickerController alloc] init];
c.delegate = self;
c.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:c animated:NO];
[c release];

虽然应用程序。工作得很好,不同寻常地在100次试验中坠毁了一次!

1 个答案:

答案 0 :(得分:1)

可能是帮助

 // u also import framework   "MobileCoreServices"

UIImagePickerController *c = [[UIImagePickerController alloc] init];
c.delegate = self;
c.sourceType = UIImagePickerControllerSourceTypeCamera;
 NSString *requiredMediaType;
     requiredMediaType = (NSString *)kUTTypeImage;
    imagePicker.mediaTypes = [NSArray arrayWithObject:requiredMediaType];
   [self presentModalViewController:c animated:NO];
 [ c release];
}




  - (void)  imagePickerController:(UIImagePickerController *)picker    didFinishPickingMediaWithInfo:(NSDictionary *)info{

        NSString  *ItemMediaType = [info objectForKey:
                               UIImagePickerControllerMediaType];



    if ([ItemMediaType isEqualToString:(NSString *)kUTTypeImage] == YES){



    UIImage *theImage = nil;

    if (picker.allowsEditing == YES){
        theImage = [info objectForKey:UIImagePickerControllerEditedImage];
    } else {
        theImage = [info objectForKey:UIImagePickerControllerOriginalImage];
    }
}