有人注意到,如果您在iOS 8中使用UIImagePickerController
和allowsEditing = 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
后,应用程序崩溃。