iOS 8 UIImagePickerController允许编辑崩溃

时间:2014-12-05 02:22:44

标签: ios ios8 uiimagepickercontroller

有人注意到,如果您在iOS 8中使用UIImagePickerControllerallowsEditing = YES,您的应用会在显示编辑视图后崩溃。

*** -[PUUIImageViewController traitCollection]: message sent to deallocated instance 0x7f8d714ab5e0

我找不到有关此PUUIImageViewController的信息。它似乎是iOS 8中的一个新类。

我在代码上花了两天时间,开始认为这可能是iOS 8中的一个错误。 有什么想法吗?

这是我打开UIImagePickerController

的代码
- (void)picButtonPressed:(id)sender {

    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {


            self.imagePickerController = [[UIImagePickerController alloc] init];
            self.imagePickerController.delegate = self;
            self.imagePickerController.allowsEditing = YES;
            self.imagePickerController.mediaTypes = @[(NSString *)kUTTypeImage];
            self.imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
            [self presentViewController:self.imagePickerController animated:YES completion:^{

            }];
        }

}

至于UIImagePickerController代表:

- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {

    [self dismissViewControllerAnimated:YES completion:^{}];

}

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


    UIImage *image = info[UIImagePickerControllerEditedImage];
    [self dismissViewControllerAnimated:YES completion:^{}];


}

控制器解除UIImagePickerController后,应用程序崩溃。

0 个答案:

没有答案