How to know annotation index MKMapview ios
问题 Hi i have 100 annotations in mapview ontap of one of its annotations i should get annotation index related to that. Does anyone have idea about getting tag number for that? Looking for any delegate method does. 回答1: Found an answer this will return annotation tapped number: - (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view { NSUInteger index = [mapView.annotations indexOfObject:view.annotation]; NSLog(@"index no %d",index); } The above code will generate