title: UITextField canBecomeFirstResponder returns NO
body: <p>In the method <code>-(void)registerUser</code> I present a modal view with 2 UITextFields and a Ok Button.</p>
  
  <p>After filling the UITextFields and pressing the Ok Button I call the delegate method <code>-(void)AEMUserRegistrationVCUserName:(NSString *)un password:(NSString *)pw</code> where I verify the data connecting to a server.</p>
  
  <p>When the answer arrives in <code>-(void)request:(RKRequest *)request didLoadResponse:(RKResponse *)response</code> If the data is wrong I try to set focus on the UITextfield with <code>self.userRegistrationVC.userName becomeFirstResponder]</code>but it does not get the focus.</p>
  
  <p>I have checked <code>[self.userRegistrationVC.userName canBecomeFirstResponder]</code> and it returns NO, which on the other hand is what the docs say it is returned by default.</p>
  
  <p>My code is here as a reference:</p>
  
  <p>Note:</p>
  
  <p><code>self.userName</code>and <code>selfPassword</code>are NSStrings.
  <code>self.userRegistrationVC</code>is a UIViewController.
  <code>self.userRegistrationVC.userName</code>and <code>self.userRegistrationVC.password</code>are UITextfields.</p>
  
  <pre><code>-(void)registerUser
  {
      //Recuperar el nombre de usuario
      self.userName = [[NSUserDefaults standardUserDefaults] objectForKey:kNombreUsuario];
      if (!self.userName) {
          //No hay nombre de usuario, el usuario nunca ha registrado la aplicación.
          if (!self.userRegistrationVC) {
              //Solicitar datos de registro
              self.userRegistrationVC = [[AEMUserRegistrationViewController alloc] initWithNibName:@"AEMUserRegistrationViewController" bundle:nil];
          }
          self.userRegistrationVC.delegate = self;
          [self.viewControllerToPresentModalView presentModalViewController:self.userRegistrationVC animated:YES];
          return;
      }
  
  
      //Recuperar la contraseña
      NSError *error;
      self.password = [SFHFKeychainUtils getPasswordForUsername:self.userName andServiceName:kServiceName error:&amp;error];
      if (!self.password) {
          //No hay contraseña. La contraseña se ha perdido.
          if (!self.userRegistrationVC) {
              //Solicitar datos de registro
              self.userRegistrationVC = [[AEMUserRegistrationViewController alloc] initWithNibName:@"AEMUserRegistrationViewController" bundle:nil];
          }
          self.userRegistrationVC.delegate = self;
          [self.viewControllerToPresentModalView presentModalViewController:self.userRegistrationVC animated:YES];
          return;
      }
  
      //Los datos del usuario existen
      //Verificar el registro
      [self.client get:kConfirmUsuario
           queryParams:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:self.userName, self.password, nil] 
                                                   forKeys:[NSArray arrayWithObjects:kNombreUsuario, kPassword, nil]]
                                                  delegate:self];
  }
  
  -(void)AEMUserRegistrationVCUserName:(NSString *)un password:(NSString *)pw
  {
      //El usuario ha introducido datos de registro
      //Realizar el registro
      self.userName = un;
      self.password = pw;
      [self.client get:kCreateUsuario 
           queryParams:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:self.userName, self.password, nil]
                                                   forKeys:[NSArray arrayWithObjects:kNombreUsuario, kPassword, nil]]
              delegate:self];
  
      //No hacer dismiss ahora esperar a verificar el registro
  }
  
  
  -(void)request:(RKRequest *)request didLoadResponse:(RKResponse *)response
  {
      //Puede responder a createUsuario o a confirmUsuario
      //En ambos casos el error impide registrar al usuario y ejecutar el programa
      BOOL isRequestCreateUser;
      NSRange aRange = [request.resourcePath rangeOfString:kCreateUsuario];
      if (aRange.location != NSNotFound) { 
          //The request was to create a user
          isRequestCreateUser = YES;
      } else {
          //The request was to check a user
          isRequestCreateUser = NO;
      }
  
  
      if (response.isConflict) {
          //Error
          [self.userRegistrationVC.userNameError setHidden:NO];
          if ([self.userRegistrationVC.password canResignFirstResponder]) {
              NSLog(@"SI"); //This return NO
          }
          if ([self.userRegistrationVC canBecomeFirstResponder]) {
              NSLog(@"SI"); //This returns NO           
          }
          [self.userRegistrationVC.userName becomeFirstResponder]; 
      }
  
      if (response.isServerError) {
          //Error
          [self.userRegistrationVC.userNameError setHidden:NO];
          [self.userRegistrationVC.userName becomeFirstResponder];                
      }
  
  
  
      if (response.isOK) {
          //Success
  
          //Retirar la pantalla de registro de usuario
          [self.viewControllerToPresentModalView dismissModalViewControllerAnimated:YES];
  
          //Si la peticion fue crear un usuario
          if (isRequestCreateUser) {
              //Guardar el nombre de usuario en las preferencias del usuario
              [[NSUserDefaults standardUserDefaults] setValue:self.userName forKey:kNombreUsuario];           
              //Guardar la contraseña en KeyChain
               [SFHFKeychainUtils storeUsername:self.userName andPassword:self.password forServiceName:kServiceName updateExisting:YES error:nil];
          }
  
          [self.delegate AEMUserRegistrationSucess];
      }    
  }
  </code></pre>
  
  <p>The sequence of calls will be:</p>
  
  <ul>
  <li>-(void)registerUser</li>
  <li>-(void)AEMUserRegistrationVCUserName:(NSString *)un password:(NSString *)pw</li>
  <li>-(void)request:(RKRequest *)request didLoadResponse:(RKResponse *)response</li>
  </ul>
  
  <p>Reading the Forum many questions are answered with [UITextField becomeFirstResponder] as a solution, so maybe I'm missing something important, and I cannot make it work.</p>
  
  <p>The docs say you can override canBecomeFirstResponder to return YES, but how can I override a UITextField method? Is this what needs to be done?</p>