UIAlertView' is deprecated: first deprecated in iOS 9.0 - UIAlertView is deprecated. Use UIAlert

  UIAlertController * cancleAlertController = [UIAlertController alertControllerWithTitle:nil message:@"你确定退出登录?" preferredStyle:UIAlertControllerStyleAlert];

    

//    第一种添加方法

    [cancleAlertController addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {

        

        NSLog(@"点击取消");

        

    }]];

 

  //    第二种添加方法

    UIAlertAction * otherAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {

        NSLog(@"点击确定");

        

    }];

    

    [cancleAlertController addAction:otherAction];

    //弹出视图

    [self presentViewController:cancleAlertController animated:YES completion:nil];

转载于:https://www.cnblogs.com/KiVen2015/p/5391661.html

你可能感兴趣的:(UIAlertView' is deprecated: first deprecated in iOS 9.0 - UIAlertView is deprecated. Use UIAlert)