title: UITextField doesn't get cursor when UITableView scrolles to not visible cell
body: <p>I have a custom grouped TableView with 5 sections and in total with 50 custom cells of type:</p>
  
  <pre><code>Label      |    XXX
  </code></pre>
  
  <p>where XXX can be UITextField, UITextView, UIButton, UILabel. Cells have mixed order in tableView.</p>
  
  <p><img src="https://i.stack.imgur.com/2OO2f.png" alt="enter image description here"></p>
  
  <p>To navigate through textFields &amp; textViews i added Next/Prev buttons on my keyboard.</p>
  
  <p><img src="https://i.stack.imgur.com/9J7I2.png" alt="enter image description here"></p>
  
  <p><strong>The problem</strong> is the when i select txtField and <strong>click Next or Prev button</strong>, the table scrolls to the needed cell position, but <strong>txtField doesn't get the cursor</strong>. In order to get the cell with textField/textView i use: </p>
  
  <pre><code> nextCell = [self tableView:_myTableView 
        cellForRowAtIndexPath:[NSIndexPath indexPathForRow:curRow inSection:curSec]];
  </code></pre>
  
  <p>I need to search through all cells in tableView, not only through the visible ones.</p>
  
  <p>As i tested, the problem is in this line of code, because if i call:</p>
  
  <pre><code>nextCell = [_myTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:curRow inSection:curSec]];
  </code></pre>
  
  <p>and the cell is visible, then the txtField gets cursor. However, if i need to jump from cell (section = 1, row = 6) to cell (section =0, row = 3) which is not visible, i get nil.</p>
  
  <p>My full code of button function:</p>
  
  <pre><code>-(void) previousTextField:(id)sender
  {
     int curTagInd = _editingTextElement.tag;
  
     NSIndexPath *curInd = [self getRowIndexOf:_editingTextElement];
     int curSec = curInd.section;
     int curRow = curInd.row;
  
     id nextView = nil;
     UITableViewCell *nextCell = nil;
  
     do {        
      curRow--;
  
      if (curRow &gt;=0) {
          nextCell = [self tableView:_myTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:curRow inSection:curSec]];//[_myTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:--curRow inSection:curInd.section]];
          curTagInd--;
          if ([nextCell isKindOfClass:[CustomCell class]] || [nextCell isKindOfClass:[CustomLongTextCell class]]) {
              do {
                  nextView = [nextCell viewWithTag:curTagInd];
                  if ([nextView isEnabled]) {
                      nextCell = nil;
                      _editingIndexPath = [NSIndexPath indexPathForRow:curRow inSection:curSec];
                      break;
                  }else{
                      break;
                  }
              } while (nextView != nil &amp;&amp; ((![nextView isKindOfClass:[UITextField class]] &amp;&amp; ![nextView isKindOfClass:[UITextView class]])  || ![nextView isEnabled]));
          }
        }
        else if(curSec &gt; 0){ //got to previous section
          curSec--;
          curRow = [self getNumberOfRowsInSection:curSec];
          curTagInd = [self getNumberOfRowsInSection:curSec]+1;
        }
        else{
          nextCell = nil;
        }
  
     } while (nextCell != nil);
  
     if (nextView != nil) {
        [self.myTableView scrollToRowAtIndexPath:_editingIndexPath atScrollPosition:UITableViewScrollPositionMiddle animated:YES];
  
        UITextField *textField = (UITextField *)nextView;
        [textField becomeFirstResponder];
     }
  }
  </code></pre>
  
  <p>Using this code i get inside method <code>textFieldShouldBeginEditing:</code>, but not in <code>textFieldDidBeginEditing:</code></p>