I have a PFUser
object with several PFRelation
pointing to other objects. When I run the following code:
PFRelation *relation = [[PFUser currentUser] relationForKey:@"Relation"];
PFQuery *query = [relation query];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error){
NSLog(@"%@", objects);
}];
it works fine. However, when I want to do the same from the local data store:
PFRelation *relation = [[PFUser currentUser] relationForKey:@"Relation"];
PFQuery *query = [[relation query] fromLocalDataStore]; // !!!
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error){
NSLog(@"%@", objects);
}];
it returns nothing, despite the fact I've pinned both my user and related objects with [myObject pinInBackground]
.
Why PFRelation
queries does not support fromLocalDataStore
? What I'm doing wrong?