For my project, I want to find/drop pins on nearby location.
Asked
Active
Viewed 1,329 times
-1
-
http://stackoverflow.com/questions/9971128/gps-location-of-peoples-using-same-product-in-100-radius-miles-using-google-map, http://stackoverflow.com/questions/6195341/objective-c-search-locations-with-radius – tipycalFlow Oct 10 '12 at 04:41
1 Answers
1
try this,
CLLocationDistance radius = 30;
CLLocation* target = [[CLLocation alloc] initWithLatitude:someLat longitude:someLon];
NSArray *locationsWithinRadius = [locations objectsAtIndexes:
[locations indexesOfObjectsPassingTest:
^BOOL(id obj, NSUInteger idx, BOOL *stop) {
return [(CLLocation*)obj distanceFromLocation:target] < radius;
}]];
[target release];

Venk
- 5,949
- 9
- 41
- 52
-
I need all nearby locations latitude, longitude. How can i get list of all latitude and longitude. – Sadia Oct 10 '12 at 05:39