I have two UIAlertView's which are not displayed one after another. Both of the have two buttons and I need to determine which button was pressed. I've tried to use
- (void)alertOKCancelAction {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Title"
message:@"Message" delegate:self
cancelButtonTitle:@"Yes" otherButtonTitles:@"No", nil];
[alert show];
[alert release];
}
- (void)alertView:(UIAlertView *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 0)
{ //Code
}
else
{//Code
}
}
But this code doesn't work if I have two UIAlertViews.
Can you help me? Thanks in advance!