0

After I spendet lots of time googling I decided to ask here. I hope someone can help me.

In my project I have some CLLocations with names to each of them. Now I want a list, maybe a tableview or something similar that the user can see which of the locations are the nearest. How can I do that? Is there an easy way to do that?

Greekings Valle

Valle
  • 67
  • 1
  • 4

1 Answers1

0

Determining the distance is just algebra:

#include <math.h>
double distance = sqrt(pow(myLat - theirLat, 2.0) + pow(myLong - theirLong, 2.0));

Sort all your distances and display how you want.

Creating a UITableView out of that is a much larger discussion and you should probably read a book or take the free Stanford course on iTunesU or something.

Chris DeSalvo
  • 913
  • 1
  • 8
  • 10