Created
August 24, 2012 02:06
-
-
Save stevemoser/3444720 to your computer and use it in GitHub Desktop.
RestKit post 4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)refreshArticles | |
{ | |
[SVProgressHUD showWithMaskType:SVProgressHUDMaskTypeGradient]; | |
__weak SMArticlesViewController *me = self; | |
[[self articlesDataSource] loadArticlesWithOnLoad:^(NSArray *newObjects) { | |
if (me != nil) { | |
[me.tableView reloadData]; | |
[SVProgressHUD dismissWithSuccess:nil afterDelay:1]; | |
} | |
} onError:^(NSError *error) { | |
[SVProgressHUD dismiss]; | |
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Error" message:[error localizedDescription] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; | |
[alert show]; | |
}]; | |
} | |
## | |
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | |
{ | |
return [[self articlesDataSource] articleCount]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment