title: iOS UITableViewCell with textfield
body: <p>I've got an <code>UITableViewCell</code> with an <code>UITextField</code> in it. This cell contains a max 3 digit string which I can edit. So far so good ;) Now I've made a previous and next button on a <code>UIToolbar</code> attached to the keyboard, which also displays correctly.</p>
  
  <p>Now for the next implementation I do: </p>
  
  <pre><code>- (void) didPressNext:(Cell *)cell
  {
      NSIndexPath *indexPath = [_tableView indexPathForCell:cell];
      NSInteger maxRows = [_tableView numberOfRowsInSection:indexPath.section];
      NSInteger maxSections = [_tableView numberOfSections];
  
      if (maxRows &gt; (indexPath.row + 1)) { //In the same section
          NSIndexPath *next = [NSIndexPath indexPathForItem:indexPath.row + 1 inSection:indexPath.section];
          Cell * nextCell = (Cell *)[_tableView cellForRowAtIndexPath:next];
  
          [_tableView scrollToRowAtIndexPath:next atScrollPosition:UITableViewScrollPositionBottom animated:NO];
          [nextCell becomeFirstResponder];
  
      } else if (maxSections &gt; (indexPath.section + 1)) { //Is there a next section
          maxRows = [_tableView numberOfRowsInSection:indexPath.section + 1];
          if (maxRows != 0) { //If there are any
              NSIndexPath *next = [NSIndexPath indexPathForItem:0 inSection:indexPath.section + 1];
  
              Cell * nextCell = (Cell *)[_tableView cellForRowAtIndexPath:next];
              if (nextCell.shirtNumber &amp;&amp; !nextCell.shirtNumber.hidden) { //Contains a shirtNumber?
                  [_tableView scrollToRowAtIndexPath:next atScrollPosition:UITableViewScrollPositionBottom animated:NO];
  
                  [nextCell becomeFirstResponder];
              }
          }
      }
  }
  </code></pre>
  
  <p>In my cell I overwrite these methods:</p>
  
  <pre><code>- (BOOL) canBecomeFirstResponder{
      return YES;
  }
  
  - (BOOL) isFirstResponder
  {
      return [_shirtNumber isFirstResponder];
  }
  
  - (BOOL) becomeFirstResponder
  {
      return [_shirtNumber becomeFirstResponder];
  }
  
  - (BOOL) resignFirstResponder
  {
      return [_shirtNumber resignFirstResponder];
  }
  </code></pre>
  
  <p>And this process works correctly some of the times and sometimes when I press twice. The animation always works so I know I calculated the next indexPath correctly.</p>
  
  <p>What am I doing wrong here?</p>
  
  <p>The question is: "Why is it that sometimes the becomeFirstResponder doesn't work and returns no"</p>