我有一个 PFQueryTableView,它应该收集 10 个最近的商店位置并按接近顺序显示它们。我像这样查询tableview:
- (PFQuery *)queryForTable {
PFQuery *query = [PFQuery queryWithClassName:@"TopToday"];
query.limit = 7;
CLLocation *currentLocation = locationManager.location;
PFGeoPoint *userLocation =
[PFGeoPoint geoPointWithLatitude:currentLocation.coordinate.latitude
longitude:currentLocation.coordinate.longitude];
return query;
}
上面的代码工作正常,只是收集了 7 个随机位置,没有特定的顺序。但是,当我添加这一行时:
[query whereKey:@"location" nearGeoPoint:userLocation withinMiles:50];
它只是返回一个空白的默认表格视图。有没有人有任何想法我为什么查询不适用于定位线?