Merge pull request #281 from steipete/example-fixes

Small fix for the tweet example.
This commit is contained in:
Mattt Thompson 2012-04-08 11:50:32 -07:00
commit cc204ec6de
2 changed files with 10 additions and 2 deletions

View File

@ -42,8 +42,10 @@
self.navigationItem.rightBarButtonItem.enabled = NO;
[Tweet publicTimelineTweetsWithBlock:^(NSArray *tweets) {
_tweets = tweets;
[self.tableView reloadData];
if (tweets) {
_tweets = tweets;
[self.tableView reloadData];
}
[_activityIndicatorView stopAnimating];
self.navigationItem.rightBarButtonItem.enabled = YES;

View File

@ -65,6 +65,12 @@
}
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Error: %@", error);
[[[UIAlertView alloc] initWithTitle:@"Error" message:[error localizedDescription] delegate:nil cancelButtonTitle:nil otherButtonTitles:@"Ok", nil] show];
if (block) {
block(nil);
}
}];
}