Reputation: 99
UITableView shows last item on the startup. How do I view the first item on the startup?
Upvotes: 0
Views: 238
Reputation: 17877
You can call following method to position your table view to any cell that you want:
- (void)scrollToRowAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UITableViewScrollPosition)scrollPosition animated:(BOOL)animated;
For example,
[tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:YES];
Upvotes: 1