Ios PresentViewController仅工作一次

Ios PresentViewController仅工作一次,ios,objective-c,xcode,presentviewcontroller,Ios,Objective C,Xcode,Presentviewcontroller,我在这里有点眼花缭乱。我确实认为这可能是件愚蠢的事情,但事情是这样的 我使用ABPadLockScreen设置密码,当我第一次打开应用程序时,如果应用程序关闭(终止)并重新打开,它工作正常,但如果我只是回家并返回,我会收到以下警告 Warning: Attempt to present <ABPadLockScreenViewController: 0x7fdc70f1d5a0> on <ViewController: 0x7fdc70f18e00> whose view

我在这里有点眼花缭乱。我确实认为这可能是件愚蠢的事情,但事情是这样的

我使用ABPadLockScreen设置密码,当我第一次打开应用程序时,如果应用程序关闭(终止)并重新打开,它工作正常,但如果我只是回家并返回,我会收到以下警告

Warning: Attempt to present <ABPadLockScreenViewController: 0x7fdc70f1d5a0> on <ViewController: 0x7fdc70f18e00> whose view is not in the window hierarchy!
如果您想知道代理的情况,那么当应用程序简单地关闭并重新打开时,密码屏幕就会显示出来,此时会出现警告

而且,如果我只是从一个视图切换到另一个视图,那该死的东西就会再次出现

提前谢谢

AppDelegate *delegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];

if (!self.pin && delegate.terminated) {
    //        [[[UIAlertView alloc] initWithTitle:@"No Pin" message:@"Please Set a pin before trying to unlock" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show];
    //return;
    [self dismissViewControllerAnimated:YES completion:nil];
} else if (!self.isPin && !delegate.terminated) {

    ABPadLockScreenViewController *lockScreen = [[ABPadLockScreenViewController alloc] initWithDelegate:self complexPin:YES];
    [lockScreen setAllowedAttempts:3];

    lockScreen.modalPresentationStyle = UIModalPresentationFullScreen;
    lockScreen.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;

    [self presentViewController:lockScreen animated:YES completion:nil];
}