Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top