I was able to get the return key to work as follows:
- Add the UITextFieldDelegate protocol to your controller.
- Set the delegate of the UIAlertView's text field to self.
- Add the following function:
Code:
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[(UIAlertView *)[textField superview] dismissWithClickedButtonIndex:1 animated:YES];
return NO;
}
This will intercept the return key press and use it to dismiss the alert with the "OK" button pressed.