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;
|
self.navigationItem.rightBarButtonItem.enabled = NO;
|
||||||
|
|
||||||
[Tweet publicTimelineTweetsWithBlock:^(NSArray *tweets) {
|
[Tweet publicTimelineTweetsWithBlock:^(NSArray *tweets) {
|
||||||
_tweets = tweets;
|
if (tweets) {
|
||||||
[self.tableView reloadData];
|
_tweets = tweets;
|
||||||
|
[self.tableView reloadData];
|
||||||
|
}
|
||||||
|
|
||||||
[_activityIndicatorView stopAnimating];
|
[_activityIndicatorView stopAnimating];
|
||||||
self.navigationItem.rightBarButtonItem.enabled = YES;
|
self.navigationItem.rightBarButtonItem.enabled = YES;
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,12 @@
|
||||||
}
|
}
|
||||||
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
|
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
|
||||||
NSLog(@"Error: %@", 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