title: iOS: scrollToRowAtIndexPath doesn't display correct top indexpath for last page
body: <p>I am trying to scroll tableview programmatically as coded following. Please note that I have increased the content size so I can see few last few remaining rows. I can scroll manually correctly to get required indexpath at top but programmatically it's not happening.</p>
  
  <pre><code>[tableview reloadData];
  
  CGSize size = tableview.contentSize;
  size.height += 1000;
  tableview.contentSize = size;
  
  int rows = [tableview numberOfRowsInSection:0];
  int numberofRowsInView = 17;
  for (int i = 0; i &lt; ceil((float)rows/numberofRowsInView); i++) {
      [tableview scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:i * numberofRowsInView inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:NO];
      ....
  }
  </code></pre>
  
  <p>For total rows 60, I expect this code to return cell views of 0-16, 17-33, 34-50, 51-59 but for the last scroll it returns 43-59 i.e. full 17 rows view while based on above code, top indexpath should be 51 for the last page!</p>
  
  <p>Can someone please help me to sort this out. Thanks.</p>
  
  <p>This is manually scrolling image:</p>
  
  <p><img src="https://i.stack.imgur.com/MUpSs.png" alt="Manually scrolling"></p>
  
  <p>This is done programmatically:</p>
  
  <p><img src="https://i.stack.imgur.com/M38wg.png" alt="Programmatically scrolling"></p>