Skip to content

Instantly share code, notes, and snippets.

@samvermette
Created January 14, 2012 21:19
Show Gist options
  • Select an option

  • Save samvermette/1612933 to your computer and use it in GitHub Desktop.

Select an option

Save samvermette/1612933 to your computer and use it in GitHub Desktop.

Revisions

  1. samvermette revised this gist Jan 14, 2012. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion gistfile1.m
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,13 @@
    - (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) {
    // do something with response
    [self.dataSource addObjectsFromArray:response];
    }];
    }

  2. samvermette revised this gist Jan 14, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.m
    Original file line number Diff line number Diff line change
    @@ -13,5 +13,5 @@ - (void)fetchData {

    // somewhere in your controller, user triggers the view of the next page

    currentPage++;
    self.currentPage++;
    [self fetchData];
  3. samvermette renamed this gist Jan 14, 2012. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. samvermette created this gist Jan 14, 2012.
    17 changes: 17 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    - (void)viewDidLoad {
    self.currentPage = 0;
    }

    - (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) {
    // do something with response
    }];
    }


    // somewhere in your controller, user triggers the view of the next page

    currentPage++;
    [self fetchData];