From e99f29429cea244369dd4f6923815e7303630069 Mon Sep 17 00:00:00 2001 From: Nikita Lutsenko Date: Mon, 22 Dec 2014 12:04:09 +0000 Subject: [PATCH] Fixed PFQueryTableViewController with Local Datastore. --- .../QueryTableViewController/PFQueryTableViewController.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ParseUI/Classes/QueryTableViewController/PFQueryTableViewController.m b/ParseUI/Classes/QueryTableViewController/PFQueryTableViewController.m index 0742958..14c779c 100644 --- a/ParseUI/Classes/QueryTableViewController/PFQueryTableViewController.m +++ b/ParseUI/Classes/QueryTableViewController/PFQueryTableViewController.m @@ -21,7 +21,7 @@ #import "PFQueryTableViewController.h" -#import +#import #import "PFActivityIndicatorTableViewCell.h" #import "PFImageView.h" @@ -158,7 +158,7 @@ - (PFQuery *)queryForTable { // If no objects are loaded in memory, we look to the cache first to fill the table // and then subsequently do a query against the network. - if ([self.objects count] == 0) { + if ([self.objects count] == 0 && ![Parse isLocalDatastoreEnabled]) { query.cachePolicy = kPFCachePolicyCacheThenNetwork; } @@ -192,7 +192,9 @@ - (void)loadObjects:(NSInteger)page clear:(BOOL)clear { PFQuery *query = [self queryForTable]; [self _alterQuery:query forLoadingPage:page]; [query findObjectsInBackgroundWithBlock:^(NSArray *foundObjects, NSError *error) { - if (query.cachePolicy != kPFCachePolicyCacheOnly && error.code == kPFErrorCacheMiss) { + if (![Parse isLocalDatastoreEnabled] && + query.cachePolicy != kPFCachePolicyCacheOnly && + error.code == kPFErrorCacheMiss) { // no-op on cache miss return; }