我使用下面的代码从相机或照片库中选择图像。在iOS 8中,它很好地挑选图像。但在iOS 9中。显示选择器视图但不选择图像。甚至没有回到控制器。点击图片什么都不做。我究竟做错了什么。UIImagePickerController不在iOS中选取图像9
- (void)showImgaePickerViewForSourceType:(UIImagePickerControllerSourceType)sourceType
{
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.modalPresentationStyle = UIModalPresentationCurrentContext;
imagePickerController.sourceType = sourceType;
imagePickerController.allowsEditing = YES;
imagePickerController.delegate = self;
self.imgPickerController = imagePickerController;
if (IS_IPAD) {
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:self.imgPickerController];
[popover presentPopoverFromRect:CGRectMake(self.view.frame.size.width/2-200, self.view.frame.size.height/2 - 300, 400, 400) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
self.popOver = popover;
}];
}else{
[self presentViewController:self.imgPickerController animated:YES completion:NULL];
}
}
你是否实现了图像选取器的委托方法? – cekisakurek
是的,我说它在iOS 8中正常工作。 – user2096064
然后向我们展示你的委托方法的实现。他们叫吗? – jcaron