Ios 使用UIAlertViewStyleSecureTextInput时应用程序崩溃

Ios 使用UIAlertViewStyleSecureTextInput时应用程序崩溃,ios,constraints,uialertview,uikeyboard,Ios,Constraints,Uialertview,Uikeyboard,我有一个非常基本的警报视图 UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Exit" message:@"Please enter the password." delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil]; alertView.tag = 2; alertView.alertViewStyle = UIAlertView

我有一个非常基本的警报视图

UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Exit" message:@"Please enter the password." delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
alertView.tag = 2;
alertView.alertViewStyle = UIAlertViewStyleSecureTextInput;
[alertView textFieldAtIndex:0].delegate = self;
[alertView show];
如果我对设置
UIAlertViewStyleSecureTextInput
进行注释,它可以正常工作,但如果我离开,在尝试显示警报视图时会崩溃:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'The layout constraints still need update after sending -updateConstraints to <_UIKeyboardLayoutAlignmentView: 0x155289c0; frame = (0 0; 0 0); userInteractionEnabled = NO; layer = <CALayer: 0x1558f510>>.
_UIKeyboardLayoutAlignmentView or one of its superclasses may have overridden -updateConstraints without calling super. Or, something may have dirtied layout constraints in the middle of updating them.  Both are programming errors.'
由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:“在发送-updateConstraints到后,布局约束仍需要更新。”。
_UIKeyboardLayoutAlignmentView或其某个超类可能在不调用super的情况下重写了-UpdateConstraint。或者,有些东西可能在更新它们的过程中弄脏了布局约束。两者都是编程错误。”
我确信我没有修改
UIAlertView
的约束,尽管我对布局的其余部分有很多约束


为什么仅仅在
UIAlertView
上有一个文本字段就会导致约束崩溃?

代码没有问题。我已经检查过了,它工作正常。由于布局限制,应用程序肯定会崩溃。尝试在警报显示后调用setNeedsUpdateConstraints。类似这样的内容-[self.view setNeedsUpdateConstraints];参考此answer@ViruMax这实际上是我的解决方案,但我还没有时间更新这个问题,尽管我没有发现这个链接。