Distance between My Position and a Pin

Hi!!! Ciao!!!

I have a little problem..

I 'd like to calculate the distance between my position and a pin with annotation inserted previously ... Can anyone help me ...?

I'm studying the solution for 2 days and I don't not how to do this....

Thanks a lot..

The simplest thing to do is come up with a solution you can understand. You can then create code more easily once that is accomplished. Here is a overview of one solution.


  1. Convert an annotation to location using the coordinate property on the MKAnnotation
  2. On the MKMapView class the userLocation property gives you the current user location
  3. Using the CLLocation object you can get distance between two locations using (- distanceFromLocation:)


In my answer on this thread, I show how you can create the MKPinAnnotation with a tap and convert the touch point to coordinates.

Distance between My Position and a Pin
 
 
Q