iOS8的iPad環境下打不開相簿或者拍照
阿新 • • 發佈:2019-02-16
但是在iOS8的iPad環境下,卻打不開相簿或者拍照,提示如下:
Warning: Attempt to present <UIImagePickerController: 0x7fb3d1167a00> on <CubeWebViewController: 0x7fb3d324ad20> which is already presenting (null)
解決方法如下:
在pop的地方加上[[NSOperationQueue mainQueue] addOperationWithBlock:^{ UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:picker]; self.popoverController = popover; [self.popoverController presentPopoverFromRect:CGRectMake(0, 0, 600, 800) inView:self.viewController.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; }];
[[NSOperationQueuemainQueue] addOperationWithBlock:^{
//code...
}];