Open an album or take a picture under the ipad, if you use Uiimagepickercontroller to open the photo album or take a photo, you have to use Uipopovercontroller to open it.
Uipopovercontroller *popover = [[Uipopovercontroller alloc] initwithcontentviewcontroller:picker]; Self.popovercontroller = PopOver; [Self.popovercontroller presentpopoverfromrect:cgrectmake (0, 0, +) InView:self.viewController.view Permittedarrowdirections:uipopoverarrowdirectionany Animated:yes];
However, in the IOS8 ipad environment, but do not open albums or take photos, prompted as follows:
Warning:attempt to present <UIImagePickerController:0x7fb3d1167a00> on <cubewebviewcontroller: 0x7fb3d324ad20> which is already presenting (NULL)
Here's how to fix it:
[[Nsoperationqueue Mainqueue] addoperationwithblock:^{ uipopovercontroller *popover = [[UIPopoverController Alloc] Initwithcontentviewcontroller:picker]; Self.popovercontroller = PopOver; [Self.popovercontroller presentpopoverfromrect:cgrectmake (0, 0, +) InView:self.viewController.view Permittedarrowdirections:uipopoverarrowdirectionany Animated:yes]; }];
Reference: Http://stackoverflow.com/questions/24942282/uiimagepickercontroller-not-presenting-in-ios-8
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Open an album or take photos in an ipad iOS8 environment