From 7ffefff6d5b2b3a594f1ba9f9d43bf20f28af45c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E4=BC=9F=E9=94=8B?= Date: Tue, 15 Sep 2015 20:23:35 +0800 Subject: [PATCH] fix following view duplicate problem --- .../Application/Home/LKHomeViewController.m | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/LIKE/LIKE/LKApplication/Application/Home/LKHomeViewController.m b/LIKE/LIKE/LKApplication/Application/Home/LKHomeViewController.m index b669714..6199a60 100644 --- a/LIKE/LIKE/LKApplication/Application/Home/LKHomeViewController.m +++ b/LIKE/LIKE/LKApplication/Application/Home/LKHomeViewController.m @@ -787,14 +787,12 @@ -(void) loadData:(LCUIPullLoaderDiretion)diretion if (self.feedType == LKHomepageFeedTypeFocus) { if (self.focusNext && diretion == LCUIPullLoaderDiretionBottom) { - [interface addParameter:self.focusNext key:@"ts"]; } } else{ - if (/*!LC_NSSTRING_IS_INVALID*/(self.next) && diretion == LCUIPullLoaderDiretionBottom) { - + if ((self.next) && diretion == LCUIPullLoaderDiretionBottom) { [interface addParameter:self.next key:@"ts"]; } } @@ -807,13 +805,13 @@ -(void) loadData:(LCUIPullLoaderDiretion)diretion if (result.state == LKHttpRequestStateFinished) { - if (self.feedType == LKHomepageFeedTypeFocus) { - - self.focusNext = result.json[@"data"][@"next"] ? result.json[@"data"][@"next"] : nil; - } - else{ - - self.next = result.json[@"data"][@"next"] ? result.json[@"data"][@"next"] : nil/*@""*/; + NSNumber *resultNext = result.json[@"data"][@"next"]; + if (resultNext) { + if (self.feedType == LKHomepageFeedTypeFocus) { + self.focusNext = resultNext; + } else { + self.next = resultNext; + } } NSArray * resultData = result.json[@"data"][@"posts"]; @@ -825,7 +823,7 @@ -(void) loadData:(LCUIPullLoaderDiretion)diretion } if (diretion == LCUIPullLoaderDiretionTop) { - + // Change datasource and save cache... if (self.feedType == LKHomepageFeedTypeFocus) {