Here is the code I'm using:
_numberOfRecords++;
[_tableView beginUpdates];
[_tableView insertRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:_numberOfRecords-1 inSection:0]] withRowAnimation:UITableViewRowAnimationBottom];
[_tableView endUpdates];
_inputField.text = @"";
CGPoint bottomOffset = CGPointMake(0, _tableView.contentSize.height + 44.0 + _tableView.contentInset.top - _tableView.bounds.size.height);
NSLog(@"%f", _tableView.contentSize.height + 44.0 + _tableView.contentInset.top - _tableView.bounds.size.height);
[_tableView setContentOffset:bottomOffset animated:YES];
This will scroll through the table view in a very strange way. But if I put the scroll code before the insert, it works fine except that it ignores the last row inserted. That is, it scrolls to the second last row instead of scrolling to the last line (of course, because it scrolls before inserting a new roll.)
Therefore, I believe that this code has no problems with the position in which it should scroll. The problem is probably related to inserting rows into a tableview. This disrupts the scrolling animation of the table view.
, .
, , , , . tableView . scrollView , , tableView .
scrollView tableView, , Apple tableView, tableView. , scrollView , tableView.
, View ?