UIAlertView crashes on iOS 8.3 with UIAlertViewStylePlainTextInput if keyboard is open

Originator:jeff
Number:rdar://20615507 Date Originated:20-Apr-2015 11:12 AM
Status:Open Resolved:
Product:iOS SDK Product Version:iOS 8.3 (12F70)
Classification:Crash Reproducible:
 
Summary:
If you attempt to show a UIAlertView on iOS 8.3, and already have the keyboard open (e.g., a UITextField is first responder), and the alertViewStyle = UIAlertViewStylePlainTextInput, then the app will crash with a NSInternalInconsistencyException

Steps to Reproduce:
1. Create UITextField and becomeFirstResponder
2. Create UIAlertView
3. Set alertViewStyle = UIAlertViewStylePlainTextInput
4. Show alert view (on iOS 8.3)

Expected Results:
It displays

Actual Results:
It crashes:

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'The layout constraints still need update after sending -updateConstraints to <_UIKeyboardLayoutAlignmentView: 0x10030ed40; frame = (0 0; 0 0); userInteractionEnabled = NO; layer = <CALayer: 0x17402c3e0>>.
_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.

Version:
iOS 8.3 (12F70)

Notes:
I'm aware that UIAlertView has been deprecated in iOS 8, but for backwards compatibility with iOS 7 it's still convenient to use it. UIAlertController does not have this bug, and I can also workaround it by resigning the first responder before showing the UIAlertView.

Configuration:
iPhone 6

Comments

I've also been able to reproduce this issue.

By joeboyscout04 at May 29, 2015, 3:45 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!