gpt4 book ai didi

ios - 另一个 UIAlertView 中的 UIAlertView 会阻止整个应用程序中的键盘输入

转载 作者:行者123 更新时间:2023-11-29 13:10:35 26 4
gpt4 key购买 nike

问题是 iOS 键盘有时不再有反应。所以没有输入是可能的。如果我取消注释 clickedButtonAtIndex 中的第二个 UIAlertView,它工作正常。

原因可能在其他地方?我不知道...

谢谢,

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{

if(buttonIndex == 1)
{
[MBProgressHUD showHUDAddedTo:self.view animated:YES];

dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, 0.05 * NSEC_PER_SEC);

dispatch_after(popTime, dispatch_get_main_queue(), ^(void){

// User exists already
RequestObject * requestObject = [RequestObject sharedRequestObject];
[requestObject loginWithEmail:self.emailTextField.text andPassword:self.passwordTextField.text
success:^(UserVO *user) {

// ...

} failure:^(ErrorVO *error) {

// User does not exist, create a new one
if (error.code == ERROR_USER_UNKNOWN) {

// ...

} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"ALERT_CAPTION_ERROR", "<Error>") message:[ErrorCode getErrorMessage:error] delegate:nil cancelButtonTitle:NSLocalizedString(@"ALERT_BUTTON_TEXT_OK", "<Ok>") otherButtonTitles:nil];
[alert show];
}
}];

[MBProgressHUD hideHUDForView:self.view animated:YES];
});
}

  • 该应用使用 Storyboard
  • [self.window makeKeyAndVisible] 已设置

最佳答案

MBProgressHUD 启动时,您将无法与 UI 进行任何交互。因此,如果不对 MBProgressHUD 进行任何内置更改,就不可能做到这一点。

关于ios - 另一个 UIAlertView 中的 UIAlertView 会阻止整个应用程序中的键盘输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17488780/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com