首页 > 移动平台 > 详细

iOS8 iPad Warning: Attempt to present <UIImagePickerController:xxxx > on xxxx which is already presenting (null)

时间:2016-07-14 13:08:48      阅读:962      评论:0      收藏:0      [点我收藏+]

解决方法:

/*
     I think this is because in iOS 8, alert views and action sheets are actually presented view controllers
     (UIAlertController). So, if you‘re presenting a new view controller in response to an action from the UIAlertView, 
     it‘s being presented while the UIAlertController is being dismissed.I worked around this by delaying the 
     presentation of the UIImagePickerController until the next iteration of the runloop, by doing this:
*/
__weak typeof(self) weakSelf = self;
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
    [weakSelf presentViewController:imagePicker animated:YES completion:nil];
}];

However, the proper way to fix this is to use the new UIAlertController API on iOS 8 (i.e. use if ([UIAlertController class]) ... to test for it). This is just a workaround if you can‘t use the new API yet.

iOS8 iPad Warning: Attempt to present <UIImagePickerController:xxxx > on xxxx which is already presenting (null)

原文:http://www.cnblogs.com/Rinpe/p/5669903.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!