MKMapView: Get clicked event on annotation pin

squeezer123 picture squeezer123 · Oct 21, 2009 · Viewed 27.6k times · Source

I am using an MKMapView containing a couple of MKAnnotation pins.
Above the map I am showing a UITableView with detailed information of the MKAnnotation pins.

My problem: When I select a pin, I would like to select the corresponding table cell. For this I would like to catch an event/delegate if the pin is selected. I am not talking about calling the callout accessory

- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control  

Answer

software evolved picture software evolved · Mar 14, 2011

Just an update to this -- in iOS 4 there are MKMapViewDelegate methods that can be used to track annotation selection and de-selection:

- (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view
- (void)mapView:(MKMapView *)mapView didDeselectAnnotationView:(MKAnnotationView *)view