Just an update for this - in iOS 4 there are MKMapViewDelegate methods that you can use to track and MKMapViewDelegate annotations:
- (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view - (void)mapView:(MKMapView *)mapView didDeselectAnnotationView:(MKAnnotationView *)view
You can use the Observer event for the selected annotation:
[pin addObserver:self forKeyPath:@"selected" options:NSKeyValueObservingOptionNew context:@"ANSELECTED"]; - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context{ NSString *action = (NSString*)context; if([action isEqualToString:@"ANSELECTED"]){ BOOL annotationAppeared = [[change valueForKey:@"new"] boolValue]; if (annotationAppeared) {
source share