- (void)viewDidLoad {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Title"
message:@"Message\nMessage"
delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", @"Cancel", nil];
message:@"Message\nMessage"
delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", @"Cancel", nil];
[alertView show];
[alertView release];
[alertView release];
}
- (void) alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 1) { // "Cancel" Button, close the alertView;
if (buttonIndex == 1) { // "Cancel" Button, close the alertView;
// Do something
} else { // buttonIndex == 0 // "OK" Button;
// Do something
}
}
}
}
No comments:
Post a Comment