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

来源:互联网 发布:淘宝微淘动态怎么看 编辑:程序博客网 时间:2024/05/29 07:32

问题:

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:^{            }];}


0 0
原创粉丝点击