Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
RestKit post 4
- (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
You can’t perform that action at this time.