As a form of validation, is there any way to prevent an alert view from dismissing when pressing an \"OK\" button?
Scenario: I have 2 text fields in the alertview fo
iOS 5 introduces a new property to UIAlertView
to handle exactly this problem.
alert.alertViewStyle = UIAlertViewStyleLoginAndPasswordInput;
Apple documentation on UIAlertView.
Add the new UIAlertViewDelegate
method to handle the enabling/disabling of the button.
- (BOOL)alertViewShouldEnableFirstOtherButton:(UIAlertView *)alertView
Apple documentation on UIAlertViewDelegate.