UIAlertView *alertView;
alertView = [[UIAlertView alloc] initWithTitle:@"Peer Disconnected!" message:nil delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Continue", nil];
[alertView show];
[alertView release];
Реализация этого метода делегата.
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if(buttonIndex == alertView.cancelButtonIndex) {
// Cancel operation...
}else if (buttonIndex == alertView.firstOtherButtonIndex) {
// Continue operation...
}
}