UIAlertView

    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"确定吗?" delegate:self cancelButtonTitle:@"cancel" otherButtonTitles:@"ok", nil];

    [alertView show];

实现委托:

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex

{

    NSLog(@"click button index is: %i", buttonIndex);

}

原文地址:https://www.cnblogs.com/xiangjune/p/4944595.html