UITextField delegate methods aren't always called in iOS 7

Originator:moshefromsinai
Number:rdar://14256419 Date Originated:June 25, 2013
Status:Open Resolved:Yes
Product:iOS SDK Product Version:7 beta 2
Classification:Serious Bug Reproducible:Always
 
Summary:

A UITextField that appears inside of a UIAlertView doesn't correctly respond to several delegate methods. A UITextField in a regular UIView behaves correctly.

Steps to Reproduce:

1. Instantiate an instance of UIAlertView.
2. Set the alertViewStyle property of the alert view to UIAlertViewStyleSecureTextInput or UIAlertViewStylePlainTextInput. (I haven't tested UIAlertViewStyleLoginAndPasswordInput thoroughly.)
3. Set the delegate on the the text field using something like this: [[alert textFieldAtIndex:0] setDelegate:self];
4. Implement textFieldShouldReturn: and textField:shouldChangeCharactersInRange:replacementString:
5. Run the app and invoke the alert view.
6. Tap the return key.

Expected Results:

The app should call textFieldShouldReturn:

Actual Results:

textField:shouldChangeCharactersInRange:replacementString: is called.

Regression:

This behaved correctly on iOS 6.

Notes:

textField:shouldChangeCharactersInRange:replacementString: is called instead of the other delegate methods. I used textFieldShouldReturn: as an example because it was the delegate method which I was initially trying to call, alerting me to the bug. (If you'll excuse the pun.)

Comments


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!