代码改变世界

UIAlertView

2015-11-07 09:47  xiangjune  阅读(146)  评论(0编辑  收藏  举报

 

    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);

}