弹出提示框,点击确定取消提示框
- (void)showError:(NSString *)errorMsg {
// 1.弹框提醒
// 初始化对话框
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"" message:errorMsg preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:nil]];
// 弹出对话框
[self presentViewController:alert animated:true completion:nil];
}
调用:
[self showError:@"内容根据需求来写啊"];