Open an album or take photos in an ipad iOS8 environment

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.