如何从相关表中过滤数据(Parse)

时间:2015-03-26 05:24:59

标签: ios parse-platform

Hiii伙伴我要表,第一个是“用户”表,第二个是“PaidChatroom”表,这里是结构

This is a user table

this is a PaidChatroom table

这是我用于最近用户的代码,它工作正常。

PFGeoPoint *userGeoPoint=[PFGeoPoint geoPointWithLatitude:currentLocation.coordinate.latitude longitude:locationManager.location.coordinate.longitude];


PFQuery *query = [PFQuery queryWithClassName:@"_User"];  
[query whereKey:@"location" nearGeoPoint:userGeoPoint withinKilometers:5000.0];
arrAllUser=[[NSMutableArray alloc]init];


[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
    arrAllUser=[objects mutableCopy];


}];

我只想要那些离我最近并购买约会的用户,我该如何过滤数据。

1 个答案:

答案 0 :(得分:0)

PFGeoPoint *userGeoPoint=[PFGeoPoint geoPointWithLatitude:currentLocation.coordinate.latitude longitude:locationManager.location.coordinate.longitude];


PFQuery *query = [PFQuery queryWithClassName:@"_User"];  
[query whereKey:@"location" nearGeoPoint:userGeoPoint withinKilometers:5000.0];
arrAllUser=[[NSMutableArray alloc]init];

[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error)
{
    arrAllUser=[objects mutableCopy];

    // Perform your second query here on the objects received inside this block for Purchased dating
}];