Skip to content

Instantly share code, notes, and snippets.

@blacklee
Created December 4, 2013 04:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blacklee/7782293 to your computer and use it in GitHub Desktop.
Save blacklee/7782293 to your computer and use it in GitHub Desktop.
UITableView load content while scrolling
- (void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
// somecode
[self performSelectorInBackground:@selector(loadMoreData:) withObject:nil];
}
- (void) loadMoreData:(id) s {
// some code to pull data from remote
dispatch_async(dispatch_get_main_queue(), ^{
[self.tableView reloadData];
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment