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

解决方法:

/*
     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.

时间: 2024-08-05 18:14:05

iOS8 iPad Warning: Attempt to present <UIImagePickerController:xxxx > on xxxx which is already presenting (null)的相关文章

Warning: Attempt to present on whose view is not in the window hierarchy!

当我想从一个VC跳转到另一个VC的时候,一般会用 - (void)presentViewController:(UIViewController *)viewControllerToPresent animated: (BOOL)flag completion:(void (^)(void))completion;当然也可以用导航push. 有时会遇到了此类警告:Warning: Attempt to present on whose view is not in the window hier

Warning: Attempt to present * on * which is already presenting *

Warning: Attempt to present (要被presented的控制器)  on (哪个控制器来presenting) which is already presenting (已经被presenting的控制器) self: 是被presented出来的控制器, self.presentingViewController: 看看是谁把self给presenting出来 RPLog(@"%@ - %@", self.presentingViewController,

Warning: Attempt to present &lt;UIAlertController: 0x7fb6ab704950&gt; on &lt;UIViewController: 0x7fb6ab51c810&gt; whose view is not in the window hierarchy!

对于在UIView上,是不能跳转的,所以我们通常要借助UIViewController,但经常会出现UIViewController没被加载的情况.这时就会报这个错. 解决方法: viewCon = (UIApplication.shared.keyWindow?.rootViewController)!  self.viewCon.present(alertView, animated: true, completion: nil); 希望后面的童鞋不要掉坑里了哦!!!!

对Warning: Attempt to present XXX on XXX whose view is not in the window hierarchy!的解决方案

下面是我找到的最靠谱的答案了.尝试后问题果然解决了.分享给大家.http://blog.csdn.net/sbvfhp/article/details/19826221 当我想从一个VC跳转到另一个VC的时候, 一般会用- (void)presentViewController:(UIViewController *)viewControllerToPresent animated: (BOOL)flag completion:(void (^)(void))completion;当然也可以用导

Warning: Attempt to present A on B whose view is not in the window hierarchy!

UIViewController 显示的主页面 添加了一个scrollView UICollectionViewController 自带collectionView UITableViewController A自带 tableView UITableViewController  B 被present的界面 把collectionView,tableView 添加到scrollView上以显示滑动效果 问题,从UICollectionViewController 的cell选中present

Attempt to present &lt;vc&gt; on &lt;vc&gt; which is already presenting &lt;vc&gt;/(null)

在给 tableViewCell 添加长按手势弹出一个 popViewController 的时候,遇到的这个变态问题: Warning: Attempt to present <UINavigationController: 0x15f259c00>  on <RepoDetailViewController: 0x160271400> which is already presenting (null) 我的solution : 不使用手势去运行此方法.换用了button的ad

Attempt to present on whose view is not in the window hierarchy!

在开发的时候,有时候会遇到 1.ios attempt to present whose view is not in the window hierarchy 2.Warning: Attempt to present on whose view is not in the window hierarchy! 等等这样类似的提示,只要里面提示有 window hierarchy,都是view hierarchy的理解不到位导致的. 上面的问题都是在一个controller的view还没加到wi

[问题解决]调用BAPI_ACC_DOCUMENT_POST时报错“被合并的公司 XXXX 和 XXXX 是不同的”

1,问题描述 调用BAPI_ACC_DOCUMENT_POST或者BAPI_ACC_DOCUMENT_CHECK时 创建或检查凭证时,报错“被合并的公司 xxxx 和 xxxx 是不同的”,比如“被合并的公司 3001 和 9999 是不同的”. 错误消息ID: F5 消息号:080 &lt;img class="alignnone size-medium wp-image-6524" src="http://www.baidusap.com/wp-content/u

Warning: Attempt to dismiss from view controller &lt;UIViewController: 0x17d71c10&gt; while a presentation or dismiss is in progress!

昨天 调试程序 已经快要上线了 突然有个BUG 找了半天 才找到是因为这个警告 但是 解决这个警告又花了一天的时间 试了各种消除控制器的方法 都不可用 其中 并且 有这个bug  手机真机测试完全没问题  只有在iPad上 有这个警告 就会出问题 第一个解决办法  试了下 半成品  上下代码 dispatch_after(dispatch_time(DISPATCH_TIME_NOW,(int64_t)(0.51 * NSEC_PER_SEC)),dispatch_get_main_queue(