// 1.创建弹框
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"恭喜你" message:@"已通关,敬请期待!" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
alert.tag = 100;
// 2.显示弹框
[alert show];
#pragma mark 点击弹框掉会用的代理方法
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (alertView.tag == 100) {
if (buttonIndex == 0) {
NSLog(@"确定");
} else {
NSLog(@"确定");
}
}
}