I have a CoreData object containing latitude and longitude coordinates. I just want to set NSPredicate to get records between specific coordinates. This is what I got so far:
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"lat <= %f AND lat >= %f AND lon <= %f AND lon >= %f",minLat,maxLat,minLon,maxLon];
This predicate returns no result at all. Then I tried to search with BETWEENfrom NSArraywith objects [NSNumber numberWithFloat:]and got a failure with the exception NSCFNumbercontstantValue unrecognized selector sent to the instance
Any suggestions would be highly appreciated.
source
share