title: UITextField is not a maximum of 1 number when I combine it with resignFirstResponder
body: <p>The code that checks if the maximum numbers is 1, works when I only use that piece of code. But when I add the automatic jumping to the next UITextField with [becomFirstResponder], it doesn't work anymore. </p>
  
  <p>Many thanks guys!</p>
  
  <p><img src="https://i.stack.imgur.com/BHOCV.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/IPqne.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/9YANZ.png" alt="enter image description here"></p>
  
  <p>When </p>
  
  <p><strong>MyViewController.h</strong></p>
  
  <pre><code>@interface GateKeeperViewController : UIViewController &lt;UITextFieldDelegate&gt;
  
  @property (strong, nonatomic) IBOutlet UITextField *firstCodeField;
  @property (strong, nonatomic) IBOutlet UITextField *secondCodeField;
  @property (strong, nonatomic) IBOutlet UITextField *thirdCodeField;
  @property (strong, nonatomic) IBOutlet UITextField *fourthCodeField;
  @property (strong, nonatomic) IBOutlet UITextField *fifthCodeField;
  </code></pre>
  
  <p><strong>MyViewController.m</strong></p>
  
  <pre><code>@synthesize firstCodeField;
  @synthesize secondCodeField;
  @synthesize thirdCodeField;
  @synthesize fourthCodeField;
  @synthesize fifthCodeField;
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
  
      [self initFieldListeners];
  }
  
  -(void) initFieldListeners {
  
      firstCodeField.delegate = self;
      secondCodeField.delegate = self;
      thirdCodeField.delegate = self;
      fourthCodeField.delegate = self;
      fifthCodeField.delegate = self;
  
      [self.firstCodeField addTarget:self
                              action:@selector(textFieldEditing:)
                    forControlEvents:UIControlEventEditingChanged];
  
      [self.secondCodeField addTarget:self
                               action:@selector(textFieldEditing:)
                     forControlEvents:UIControlEventEditingChanged];
  
      [self.thirdCodeField addTarget:self
                              action:@selector(textFieldEditing:)
                    forControlEvents:UIControlEventEditingChanged];
  
      [self.fourthCodeField addTarget:self
                               action:@selector(textFieldEditing:)
                     forControlEvents:UIControlEventEditingChanged];
  
      [self.fifthCodeField addTarget:self
                              action:@selector(textFieldEditing:)
                    forControlEvents:UIControlEventEditingChanged];
  }
  
  - (void)textFieldEditing:(UITextField *)textField
  {
      if(textField == self.firstCodeField ){
          if ([self.firstCodeField.text length] == 1) {
              [self.secondCodeField becomeFirstResponder];
          }
      }
  
      if(textField == self.secondCodeField ){
          if ([self.secondCodeField.text length] == 1) {
              [self.thirdCodeField becomeFirstResponder];
          }
      }
  
      if(textField == self.thirdCodeField ){
          if ([self.thirdCodeField.text length] == 1) {
              [self.fourthCodeField becomeFirstResponder];
          }
      }
  
      if(textField == self.fourthCodeField ){
          if ([self.fourthCodeField.text length] == 1) {
              [self.fifthCodeField becomeFirstResponder];
          }
      }
  }
  
  - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
  {
      NSUInteger newLength = [textField.text length] + [string length] - range.length;
      return (newLength &gt; 1) ? NO : YES;
  
  }
  </code></pre>