Reputation: 11
The problems is that the iOS keyboard sometimes does not react anymore. So no input is possible.
If I uncomment the second UIAlertView
in clickedButtonAtIndex
it works fine.
The reason might be somewhere else? I have no idea ...
Thank you,
- (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]
is setUpvotes: 1
Views: 153
Reputation: 47059
When MBProgressHUD
starts then you are not able to do any interaction with UI
. So it is not possible to do it without any built-in changes of MBProgressHUD
.
Upvotes: 1