Find nearest annotations from user location ios?
问题 I have an array of annotations.I am calculating the distance between each annotation from user location.What I want to know is, how can I find lets say 3 nearest annotations from these distances? Here is how I am calculating distance from user location to annotations. CLLocation *userLocation = self.mapView.userLocation.location; for (Annotation *obj in annotations) { CLLocation *loc = [[CLLocation alloc] initWithLatitude:obj.coordinate.latitude longitude:obj.coordinate.longitude]; //