[英]how to filter data from related table (Parse)
嗨,我必须要桌子,首先是“用户”表,其次是“付费聊天室”表,这里是结构
这是我为最近的用户使用的代码,它工作正常。
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];
}];
我只需要那些最接近我并购买了约会的用户,我该如何过滤数据。
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
}];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.