Do what @Adrian Pirvulescu said, but do it before the warning alert.tag = 1;, and then when - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndexdo is called :
if (alertView.tag == 1) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"2nd Alert"
message:@"My message" delegate:self cancelButtonTitle:@"Cancel"
otherButtonTitles:@"OK", nil];
alert.tag = 2;
[alert show];
[alert release];
}
else if (alertView.tag == 2) {
[self CallSomeMethod];
}
else {
}
source
share