在ios9及以上系统中创建对话框并弹出
//初始化提示框;
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"用户名或密码出现错误" preferredStyle: UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
//此处书写按钮的点击事件
}]];
//弹出提示框;
[self presentViewController:alert animated:true completion:nil];