Skip to content
This repository was archived by the owner on Jan 16, 2021. It is now read-only.

Commit 7b82a0a

Browse files
committed
Merge pull request #20 from ParsePlatform/nlutsenko.12222014.lds
Fixed PFQueryTableViewController with Local Datastore.
2 parents 9e3c61c + e99f294 commit 7b82a0a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ParseUI/Classes/QueryTableViewController/PFQueryTableViewController.m

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#import "PFQueryTableViewController.h"
2323

24-
#import <Parse/PFQuery.h>
24+
#import <Parse/Parse.h>
2525

2626
#import "PFActivityIndicatorTableViewCell.h"
2727
#import "PFImageView.h"
@@ -158,7 +158,7 @@ - (PFQuery *)queryForTable {
158158

159159
// If no objects are loaded in memory, we look to the cache first to fill the table
160160
// and then subsequently do a query against the network.
161-
if ([self.objects count] == 0) {
161+
if ([self.objects count] == 0 && ![Parse isLocalDatastoreEnabled]) {
162162
query.cachePolicy = kPFCachePolicyCacheThenNetwork;
163163
}
164164

@@ -192,7 +192,9 @@ - (void)loadObjects:(NSInteger)page clear:(BOOL)clear {
192192
PFQuery *query = [self queryForTable];
193193
[self _alterQuery:query forLoadingPage:page];
194194
[query findObjectsInBackgroundWithBlock:^(NSArray *foundObjects, NSError *error) {
195-
if (query.cachePolicy != kPFCachePolicyCacheOnly && error.code == kPFErrorCacheMiss) {
195+
if (![Parse isLocalDatastoreEnabled] &&
196+
query.cachePolicy != kPFCachePolicyCacheOnly &&
197+
error.code == kPFErrorCacheMiss) {
196198
// no-op on cache miss
197199
return;
198200
}

0 commit comments

Comments
 (0)