How to know when UITableView-reloadData finished?

I'm calling reloadData on my table view and once it is done, I need to select a particular cell, how do I know when the reloadData is finished so I can do the select?

iPhoneOS 3.1 & 3.2

Posted on Sep 30, 2010 7:55 AM

Reply
4 replies

Sep 30, 2010 11:11 AM in response to danielt63

Instead of directly calling selectRowAtIndexPath, try performing the selector after a delay. The delay could just be 0.


- (void) selectRowAtIndexPath:(NSIndexPath *) path {
// Replace animated and scrollPos with the values you want to use
[tableView selectRowAtIndexPath:path animated:animated scrollPosition:scrollPos];
}
- (void) foo {
[tableView reloadData];
[self performSelector:@selector(selectRowAtIndexPath:) withObject:indexPath afterDelay:0.0];
}



-TRS

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to know when UITableView-reloadData finished?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.