1
votes

I'm using parse.com for my app. So i have a query. I need to find all posts objects. Each post has an author column. So I need to find all posts of people nearby location. I use such code:

PFQuery *postsQuery = [PFQuery queryWithClassName:@"Post"];
PFQuery *locationQuery = [PFUser query];

[locationQuery whereKey:@"location" nearGeoPoint:geoPoint withinKilometers:3.0f];
[postsQuery whereKey:@"author" matchesQuery:locationQuery];
[postsQuery orderByDescending:kPostKeyDate];
[postsQuery findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {

}];

And the problem is that I only get posts of current user despite the fact that there are a lot of users with posts around. Can anybody suggest the solution? Thanks in advance.

1
What ACL permissions do you have on the user location? - Wain

1 Answers

0
votes

ОК! So the problem was that I've set up ACL for posts only for current user. Pretty easy!