码迷,mamicode.com
首页 > 移动开发 > 详细

【问题处理】Application tried to present modally an active controller

时间:2015-04-22 14:01:02      阅读:521      评论:0      收藏:0      [点我收藏+]

标签:presentedviewcontrol   nsinvalidargumentexc   tried to present   active controller   

问题:

Terminating app due to uncaught exception ‘NSInvalidArgumentException‘, reason: ‘Application tried to present modally an active controller <TabbarViewController: 0x1765dbe0>.‘


解决方法:

判断controller是不是有presentedViewController,没有的话才可以present

if ([UIApplication sharedApplication].delegate.window.rootViewController.presentedViewController == nil) {
    [[UIApplication sharedApplication].delegate.window.rootViewController presentViewController:self.gesturePasswordController animated:YES completion:^{
        
    }];
}


【问题处理】Application tried to present modally an active controller

标签:presentedviewcontrol   nsinvalidargumentexc   tried to present   active controller   

原文地址:http://blog.csdn.net/u011439689/article/details/45193057

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