如果已经不在本页了, 不要设置内容, alert

This commit is contained in:
life
2015-11-02 18:52:38 +08:00
parent 62e1754c6d
commit 4ede2afa23
5 changed files with 21 additions and 7 deletions

View File

@@ -86,6 +86,7 @@ static NSInteger const MaximumNumberOfPictures = 10;
@property (nonatomic) BOOL isMarkdown;
@property (nonatomic) BOOL edited;
@property (nonatomic) BOOL isClosed;
@property BOOL isInited;
@@ -222,7 +223,7 @@ static NSInteger const MaximumNumberOfPictures = 10;
// loading
[self hideProgress];
self.isClosed = YES;
[super viewWillDisappear:animated];
}
@@ -405,13 +406,26 @@ BOOL hiddenBar = NO;
[self showProgress];
[Leas.note getNoteContent:self.note success:^(NSString * content) {
//
if(self.isClosed) {
return;
}
[self setBodyText:content];
[self enableRightButtons];
[self hideProgress];
} fail:^{
// , alert
if(self.isClosed) {
return;
}
[self hideProgress];
[LeaAlert showAlertWithTitle:NSLocalizedString(@"Error", nil) message:NSLocalizedString(@"Cannot fetch note's content", nil) withSupportButton:NO okPressedBlock:^(UIAlertView *alertView) {
[LeaAlert showAlertWithTitle:NSLocalizedString(@"Error", nil) message:NSLocalizedString(@"Cannot fetch note's content", nil) withSupportButton:NO okPressedBlock:^() {
if(self.isClosed) {
return;
}
//
// ,
[self.navigationController popViewControllerAnimated:YES];
}];
}];