Hi I wrote the following code:
- (IBAction)DelBlockB:(id)sender {
confirmDelB = [[UIAlertView alloc] initWithTitle:@"Attention" message:[NSString stringWithFormat:@"are you sure you want to delete and block %@", idnameArr[2]] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Cancel", nil];
[confirmDelB show];
}
- (IBAction)DelFB:(id)sender {
confirmDel = [[UIAlertView alloc] initWithTitle:@"Attention" message:[NSString stringWithFormat:@"are you sure you want to delete %@", idnameArr[2]] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Cancel",nil];
[confirmDel show];
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 0) {
NSLog(@"ok");
}
else {
NSLog(@"cancel");
}
}
where the method "clickedButtonAtIndex" will return an answer no matter what UIAlertView was Pressed, how can I show an answer only if one of the alert was clicked ?