提示的简易写法

1.提示的声明方法
 
UIAlertView *alert = [[UIAlertViewalloc] initWithTitle:@"提示"
                                                    message:@"您还没有支付哦,返回将取消订单,确认返回?"
                                                   delegate:nil
                                          cancelButtonTitle:@"返回"
                                          otherButtonTitles:@"继续支付", nil];
alert.tag = 1002;
alert.delegate = self;
[alert show];
 
 
2.代理写法:
 
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    if (alertView.tag == 1001) {
        return;
    }
   
    if (buttonIndex == 1) {
        return;
    }
    else {
        [supergoBack];
    }
}
 
 
- OVER
 
 
原文地址:https://www.cnblogs.com/firstrate/p/7888112.html