UIAlertViewDelegate Bug

Originator:aharris.1990
Number:rdar://16022166 Date Originated:09-Feb-2014 07:08 PM
Status:Open Resolved:No
Product:iOS SDK Product Version:7.0
Classification:Bug Reproducible:Always
 
Summary:
- (BOOL)alertViewShouldEnableFirstOtherButton:(UIAlertView *)alertView

This delegate method has a bug where if you return an a [textField hasText] call from it, it will fail when the number of characters returned from it is even. [textField hasText] will return the length of the string when it is not the first responder. So when the delegate method is called and the first text field you are checking is not the first responder, and the number of characters in the text field is even, the first other button should enable itself, but it doesn't.

Steps to Reproduce:
1. Implement the - (BOOL)alertViewShouldEnableFirstOtherButton:(UIAlertView *)alertView delegate and return [[alertView textFieldAtIndex:0] hasText]; from it.

2. Show a UIAlertView with UIAlertViewStyleLoginAndPasswordInput type.

3. Type 4 characters in the first text field.

4. Begin typing in the second text field.

5. You will see the first other button erroneously disables itself.

Expected Results:
The first other button should not disable itself.

Actual Results:
The first other button disables itself.

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!