Search code examples
objective-ciphoneios7ios5xcode5

Auto scroll while clicking UITableView didSelectRowAtIndexPath ios-ObjectiveC


How to scroll up the TableView or cell while i am clicking loadmore from option from UITableView didSelectRowAtIndexPath


Solution

  • NSIndexPath* ip = [NSIndexPath indexPathForRow:[arrData count]-1 inSection:0];
    [self.tableView scrollToRowAtIndexPath:ip atScrollPosition:UITableViewScrollPositionTop animated:NO];
    

    arrData is the Data source you feed to the TableView. By setting IndexPath to [arrData count] you can go to the bottom of the TableView