2015-06-20 62 views
0

我辞职的文本字段,一旦我得到服务器的响应。 但在ios 8.3上它没有退出键盘。键盘不辞职辞职后,它在ios 8.3

这里是我正在做的.i已经辞职的文本字段和获得服务器的响应后,但它没有得到辞职。并同时向我展示警报和键盘。

其在iOS 8.2

工作这是我的代码

-(void)reciveResponseForEmail 
{ 
    [internetDownTimer invalidate]; 
    [self.emailTextField resignFirstResponder]; //resign text feild 
    [ActivityIndicatorUtility finishedWaiting]; 

    if ([[responseDictionary valueForKey:@"success"] integerValue]==1) 
    { 
     RegistryConfirmViewController *objRegConfirmVC=[[RegistryConfirmViewController alloc]initWithNibName:@"RegistryConfirmViewController" bundle:[NSBundle mainBundle]]; 
     objRegConfirmVC.signRegistryDetailInfoDict=(NSMutableDictionary*)[[NSDictionary alloc]initWithDictionary:responseDictionary]; 

     objRegConfirmVC.isFromEmail=YES; 

     objRegConfirmVC.signRegistryAray=[[NSMutableArray alloc]initWithArray:self.serviceObjectArray]; 
     [self.navigationController pushViewController:objRegConfirmVC animated:YES]; 
    } 
    else if (responseDictionary==nil && [responseDictionary count]== 0) //condition apply in case of SERVER failed 
    { 
     [self showAlertForOfflineMode]; 
    } 
    else 
    { 
     float iOSVersion = [[UIDevice currentDevice].systemVersion floatValue]; 

     if (iOSVersion >= 8.0f) 
     { 

      UIAlertController *alertVC1 = [UIAlertController alertControllerWithTitle:@"Alert" message:AMLocalizedString(@"Sorry, we were unable to find any information associated with that email.", nil) preferredStyle:UIAlertControllerStyleAlert]; 
      UIAlertAction *cancelAction = [UIAlertAction 
              actionWithTitle:AMLocalizedString(@"OK",nil) 
              style:UIAlertActionStyleCancel 
              handler:^(UIAlertAction *action) 
              { 
               [alertVC1 dismissViewControllerAnimated:YES completion:nil]; 
               SignRegistryViewController *objSignRegistryVC=[[SignRegistryViewController alloc]initWithNibName:@"SignRegistryViewController" bundle:[NSBundle mainBundle]]; 

               objSignRegistryVC.returningGuestEmail=[NSString stringWithFormat:@"%@",self.emailTextField.text]; 
               objSignRegistryVC.signRegistryArray=[[NSMutableArray alloc]initWithArray:self.serviceObjectArray]; 

               [self.navigationController pushViewController:objSignRegistryVC animated:NO]; 
              }]; 

      [alertVC1 addAction:cancelAction]; 

      alertVC1.modalPresentationStyle = UIModalPresentationPageSheet; 
      alertVC1.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; 
      [self presentViewController:alertVC1 animated:NO completion:nil]; 
     } 
     else 
     { 
      UIAlertView *alertMe=[[UIAlertView alloc] initWithTitle:@"Alert" message:AMLocalizedString(@"Sorry, we were unable to find any information associated with that email.", nil) delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; 
      [alertMe show]; 
     } 
    } 
} 
+0

键盘和提醒都同时看:( – Nik

+0

你怎么辞职键盘我无法找到的代码 –

+0

我已经使用[self.emailTextField resignFirstResponder];显示之前警告 – Nik

回答

0

,当你想隐藏键盘只需拨打这个在您的视图控制器。 ?

[self.view endEditing:NO]; 
+0

耶试过太多,但没有帮助 – Nik

+0

请添加代码,你尝试哟隐藏键盘和调用者的代码 – agy

+0

我已经通过使用 – Nik