How to calculate the distance between two location points?

2

I need to calculate the shortest distance between two locations obtained automatically through CoreLocation .

To be more specific, the idea is to mark a starting point and after the user "walk" a little, I need to calculate the distance traveled when you get to another location

    
asked by anonymous 22.06.2015 / 15:26

1 answer

2

From two objects CLLocation you get the distance, in meters, through the distanceFromLocation method. Example:

CLLocationDistance distance = [location1 distanceFromLocation:location2];
    
22.06.2015 / 15:57