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, [UIApplication sharedApplication].keyWindow.rootViewController);

打印结果: <RPNavigationController: 0x789d0330> - <RPNavigationController: 0x789d0330>

结论: poopver中的控制器, 其实是通过窗口的根控制器presenting出来的, 所以要想窗口的根控制器再presenting其他控制器,需要先dismiss掉原来presenting的控制器,

否则会出现如下错误:

Warning: Attempt to present <RPNavigationController: 0x790dad10>  on <RPNavigationController: 0x78e76c70> which is already presenting <RPRegionViewController: 0x78f76700>

时间: 2024-10-14 00:26:19

Warning: Attempt to present * on * which is already presenting *的相关文章

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 &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

iOS8 iPad Warning: Attempt to present &lt;UIImagePickerController:xxxx &gt; 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 w

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

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(

百度地图导航算路成功但是无法进入导航页面

百度地图导航算路成功但是无法进入导航页面Warning: Attempt to present <UINavigationController: 0x163852800> on <UIViewCont 在导航页面.m中增加 -(id)naviPresentedViewController { return self; }