tags:

views:

38

answers:

1

I have some Annotationview on map. I just wanna detect event that happen when user touch it. I figure out using observer, I add observer for each annotationview in viewForAnnotation delegate method. I thought it would work perfect, but something still wrong. "selected" attribute of annotationview change its value unexpectedly. Someone tell me how to solve this problem. Thanks!

A: 

Hello,

You should see about the MKMapViewDelegate there is this method to implement in order to do that :

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

See the apple's doc http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MKMapViewDelegate_Protocol/MKMapViewDelegate/MKMapViewDelegate.html

Christophe Debove