[IOS UIalert模版]

1.alertview创建

UIAlertView *alert;
        alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"题库有更新,需要更新吗?" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:@"取消", nil];
        [alert setTag:1];
        [alert show];

2.回调函数

- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
   
    if ([alertView tag] == 1) {
        if (buttonIndex == 0) {     // and they clicked OK.
           //更新题库
        }
    }
    
}

 

posted @ 2014-09-08 11:38  Rayshen  阅读(160)  评论(0编辑  收藏  举报