码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2015-10-15 15:45:10      阅读:245      评论:0      收藏:0      [点我收藏+]

标签:

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>

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

标签:

原文地址:http://www.cnblogs.com/Rinpe/p/4882408.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!