i have latitude and longitude of particular place and i want to calculate the distance so how can i calculate it?
CLLocation *location1 = [[CLLocation alloc] initWithLatitude:lat1 longitude:long1];
CLLocation *location2 = [[CLLocation alloc] initWithLatitude:lat2 longitude:long2];
NSLog(@"Distance i meters: %f", [location1 distanceFromLocation:location2]);
[location1 release];
[location2 release];
You also need to add CoreLocation.framework
to your project, and add the import statement:
#import <CoreLocation/CoreLocation.h>