ios 9 UIAlertController 代替 UIAlertView
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:@"静" preferredStyle:(UIAlertControllerStyleAlert)];
UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"确定" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction *action) {
NSLog(@"注意学习");
}];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:(UIAlertActionStyleCancel) handler:^(UIAlertAction *action) {
// 点击按钮后的方法直接在这里面写
NSLog(@"注意学习");
}];
// 创建警告按钮
UIAlertAction *structlAction = [UIAlertAction actionWithTitle:@"警告" style:(UIAlertActionStyleDestructive) handler:^(UIAlertAction *action) {
NSLog(@"注意学习");
}];
[alertController addAction:okAction];
[alertController addAction:cancelAction];
[alertController addAction:structlAction];
[self presentViewController:alertController animated:YES completion:nil];