Saturday, March 24, 2012

Dismiss UIAlertView without clicking the button

If need to dismiss the UIAlertView without clicking the button, we could use the below method.



-(void) showAlert {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Connecting to server" message:@"Please wait ..." delegate:self cancelButtonTitle:nil otherButtonTitles: nil];
[alert show];
}

-(void) anotherMethod {
yourCode...add the below method
[alert dismissWithClickedButtonIndex:0 animated:TRUE];
[alert release];
}



No comments:

Post a Comment