fixes a blocked reload button once we hit an error. Also shows an alert now.
This commit is contained in:
parent
0470f4b29f
commit
88920034e2
2 changed files with 10 additions and 2 deletions
|
|
@ -42,8 +42,10 @@
|
|||
self.navigationItem.rightBarButtonItem.enabled = NO;
|
||||
|
||||
[Tweet publicTimelineTweetsWithBlock:^(NSArray *tweets) {
|
||||
if (tweets) {
|
||||
_tweets = tweets;
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
[_activityIndicatorView stopAnimating];
|
||||
self.navigationItem.rightBarButtonItem.enabled = YES;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue