Scroll immediately to row in table before view shows

Thanks to Shaggy and Dying Cactus for pointing me in the right direction. The answer is to load the table and scroll in viewWillAppear:

-(void)viewWillAppear:(BOOL)animated
{
    [theTable reloadData];
    NSIndexPath *scrollToPath = [NSIndexPath indexPathForRow:5 inSection:0]; 
    [theTable scrollToRowAtIndexPath:scrollToPath atScrollPosition:UITableViewScrollPositionTop animated:NO];   
}

i had the exact same problem, after trying everything, this worked, the key is if you're using autolayout , you must write scrollToBottom code in viewDidLayoutSubviews

initialize scrollToBottom to true and then do this

- (void)viewDidLayoutSubviews {
    [super viewDidLayoutSubviews];
    // Scroll table view to the last row
    [self scrollToBottom];
}

-(void)scrollToBottom {
    if (shouldScrollToLastRow)
    {
        CGPoint bottomOffset = CGPointMake(0, self.tableView.contentSize.height - self.tableView.bounds.size.height);
        [self.tableView setContentOffset:bottomOffset animated:NO];
    } }

doing this will ensure you're almost at the bottom of you're tableView but might not be at the very bottom as its impossible to know the exact bottom offset when you're at the top of the tableView, so after that we can implement scrollViewDidScroll

-(void)scrollViewDidScroll: (UIScrollView*)scrollView
{
    float scrollViewHeight = scrollView.frame.size.height;
    float scrollContentSizeHeight = scrollView.contentSize.height;
    float scrollOffset = scrollView.contentOffset.y;

    // if you're not at bottom then scroll to bottom
    if (!(scrollOffset + scrollViewHeight == scrollContentSizeHeight))
    {
        [self scrollToBottom];
    } else {
    // bottom reached now stop scrolling
        shouldScrollToLastRow = false;
    }
}

Calling scrollToRowAtIndexPath: in viewWillAppear: does not work for me because tableView is not loaded yet. But I could solve this with calling scrollToRowAtIndexPath: after some delay.

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

    [self performSelector:@selector(scrollToCell) withObject:nil afterDelay:0.1];
}

- (void) scrollToCell
{
    [_tableView reloadData];
    NSIndexPath *scrollToPath = [NSIndexPath indexPathForRow:5 inSection:0];
    [_tableView scrollToRowAtIndexPath:scrollToPath atScrollPosition:UITableViewScrollPositionTop animated:NO];
}

Hope it will help someone.