// 弹出确定取消按钮
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"输入信息有误,请重新输入" message:nil preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"好的" style:UIAlertActionStyleDefault handler:nil];
[alertController addAction:okAction];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:nil];
[alertController addAction:cancelAction];
[self presentViewController:alertController animated:YES completion:nil];
// 1秒后自动消失
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"输入信息有误,请重新输入" message:nil preferredStyle:UIAlertControllerStyleAlert];
[self presentViewController:alertControlleranimated:YES completion:nil];
[NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(creatAlert:) userInfo:alertControllerrepeats:NO];
- (void)creatAlert:(NSTimer *)timer{
UIAlertController *alert = [timer userInfo];
[alert dismissViewControllerAnimated:YES completion:nil];
alert = nil;
}