【问题处理】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:^{
        
    }];
}


你可能感兴趣的:(TO,controller,Active,present,tried)