简体   繁体   中英

Parse.com query trouble

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM