I have this code:
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if(buttonIndex == 0)
{
}
else if(buttonIndex == 1)
{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Danger"
message:@"war"
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertView show];
[alertView release];
}
}
but but every time i push ok of this UIAlert it return inside this delegate method; how can I solve this thing? Can I use a BOOL for the control?
Set the delegate of the second
alertViewto nil.However, if you wish to add options to the second on in the future, you can set a
tagvalue to thealertViewand check the tags on call of the delegate method. Depending on thetagvalue you would perform a different task.