Skip to content

Instantly share code, notes, and snippets.

@samvermette
Created January 14, 2012 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save samvermette/1612933 to your computer and use it in GitHub Desktop.
Save samvermette/1612933 to your computer and use it in GitHub Desktop.
- (void)viewDidLoad {
self.currentPage = 0;
self.dataSource = [[NSMutableArray alloc] init];
}
- (void)fetchData {
[[SVHTTPClient sharedClient] GET:@"https://api.github.com/users/AndrewGertig/watched"
parameters:[NSDictionary dictionaryWithValue:[NSNumber numberWithInt:self.currentPage] forKey:@"page"]
completion:^(id response, NSError *error) {
[self.dataSource addObjectsFromArray:response];
}];
}
// somewhere in your controller, user triggers the view of the next page
self.currentPage++;
[self fetchData];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment