1
问题是iOS键盘有时不再反应。所以没有输入是可能的。 如果我取消注释clickedButtonAtIndex
中的第二个UIAlertView
,它工作正常。UIAlertView在另一个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];
});
}
}
- 应用程序使用故事板
[self.window makeKeyAndVisible]
设置