1.ios7的弹框
// ios7弹框的创建
// 弹框的创建
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"欢迎" message: @"欢迎来到德莱联盟" delegate:nil cancelButtonTitle:@"取消" otherButtonTitles:nil, nil];
// 显示弹框
[alert show];
注意点:Title:弹框最上面的标题,message:弹框中间详细信息,cancelButtonTitle:取消按钮的文字
2.ios8弹框
// ios8弹框
// 创建弹框
[super viewDidAppear:(BOOL)animated];
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"中奖" message:@"恭喜你中奖了" preferredStyle:UIAlertControllerStyleAlert];
// 添加弹框的取消按钮
UIAlertAction *action = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];
[alert addAction:action];
// 显示弹框
[self presentViewController:alert animated:NO completion:nil];}