How to find the distance between two locations using Apple maps in iOS 6?

rani picture rani · Jun 22, 2013 · Viewed 7.4k times · Source

My requirement is to find the distance in miles between two locations without using the Google API. I added code as:

CLLocation* first = [[CLLocation alloc] initWithLatitude:35.779702 longitude:-78.641746];
CLLocation* second = [[CLLocation alloc] initWithLatitude:40.723779 longitude:-73.991289];

CLLocationDistance distance = [first distanceFromLocation:second];
NSLog(@"distance  in Miles ::%f",distance*0.00062137);

It is giving distance as 424.151386 but when I check in iPad it is giving 497 miles.

Please give me solution for this difference.

Answer