It's complicated! I just implemented something similar (although I subclassed MKAnnotationView), and when I tried to add the annotationView:didChange delegate method to my view controller, it didn't receive the call, although I managed to drag the annotation
I also copied / pasted your code into my view controller, and it worked right out of the box, with a delegate method call and all!
The only thing I can think of is that instead of passing the mvMap to dequeueReusableAnnotationViewWithIdentifier: try passing the mapView object that is provided by the delegate method. Based on the code you specified above, I can’t say if they are the same object, so maybe it’s worth taking a picture?
aView=(MKAnnotationView *) [mvMap dequeueReusableAnnotationViewWithIdentifier:annotation.title];
[EDIT TO ADD MY CODE AS LIST]
- (MKAnnotationView *)mapView:(MKMapView *)theMapView viewForAnnotation:(id<MKAnnotation>)annotation { static NSString* ParkAnnotationIdentifier = @"ParkAnnotationIdentifier"; MKAnnotationView* parkAnnotationView = (MKAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:ParkAnnotationIdentifier]; if (!parkAnnotationView) { MKAnnotationView *annotationView = [[[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:ParkAnnotationIdentifier] autorelease]; UIImage *imageIcon = [UIImage imageNamed:@"scooterIcon.png"]; annotationView.image = imageIcon; annotationView.draggable = YES; return annotationView; } else { parkAnnotationView.annotation = annotation; } return parkAnnotationView; }
source share