I have a PFQueryTableView which is supposed to gather the 10 closest store locations and display them in order of proximity. I query the tableview like so:
- (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;
}
The above code works fine, just gathers 7 random locations in no particular order. However, when I add this line:
[query whereKey:@"location" nearGeoPoint:userLocation withinMiles:50];
It just returns a blank default tableview. Does anyone have any thoughts I why the query does not work with the location line?