Is there a way to hide UIAlertView programmatically? Actually I have added a UITextField in UIAlertView and I want to perform the same operation as on "Ok" button press when a user hits the keyboard return key.
You need to set two things. UIAlertView *alert1 = [[UIAlertView alloc]initWithTitle:@"title" message:@"message" delegate:nil cancelButtonTitle:nil otherButtonTitles:nil]; [alert1 show]; [self performSelector:@selector(dismiss:) withObject:alert1 afterDelay:1.0];
1. From the Alerts tab, under Alerts, click Inbox. 2. On the Alerts Inbox page, click the check boxes in front of the alerts you want to dismiss, then click the Dismiss button.
Call
[theAlertView dismissWithClickedButtonIndex:0 animated:YES];
when you handle the return key.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With