Hiii伙伴我要表,第一个是“用户”表,第二个是“PaidChatroom”表,这里是结构
这是我用于最近用户的代码,它工作正常。
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];
}];
我只想要那些离我最近并购买约会的用户,我该如何过滤数据。
答案 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
}];