When buttons are clicked in a UIAlertView its delegation method
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
called out. Your delegate should implement this method and check which button was clicked.
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
switch (buttonIndex) {
case 0:
break;
case 1:
break;
...
}
}
If you have several types of warnings, you can distinguish them by name as follows:
if ([alertView.title isEqualToString: yourAlertView.title]) {
}
user745098
source
share