Is there a method (or any way) you can get the "index path" of the annotation inside the method:
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id)annotation
What I want to do is get something inside an array according to the annotation. One of the methods I think that I want to copy is - tableView:cellForRowAtIndexPath:
and use the "indexPath".
Searched a lot but not found any result. Or maybe I'm just bad at searching. Any reference will be greatly appreciated.
NSUInteger index = [mapView.annotations indexOfObject:annotation];
Since the underlying array is a mutable one, note that the index
can change. This seems to be the closest indexPath
like information you can get.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With