问题是 iOS 键盘有时不再反应。所以没有输入是可能的。如果我取消注释第二个UIAlertView
就clickedButtonAtIndex
可以了。
原因可能在其他地方?我不知道 ...
谢谢,
- (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]
已设置