【问题处理】Application tried to present modally an 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:^{
        
    }];
}


郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。