I wondered what is wrong here. The annotation is showing the default red pin. I have copied the image file into the project folder and checked the names.
- (MKAnnotationView *)mapView:(MKMapView *)aMapView
viewForAnnotation:(id)ann {
NSString *identifier = @"myPin";
MKPinAnnotationView *annView = (MKPinAnnotationView *)
[aMapView dequeueReusableAnnotationViewWithIdentifier:identifier];
if (annView == nil) {
annView= [[[MKPinAnnotationView alloc] initWithAnnotation:ann
reuseIdentifier:identifier]
autorelease];
} else {
annView.annotation = ann;
}
annView.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
UIImage *pinImage = [UIImage imageNamed:@"AnnotationIcon.png"];
[annView setImage: pinImage];
annView.enabled = YES;
annView.animatesDrop=TRUE;
annView.canShowCallout=YES;
return annView;
}
After some researching, I found out that the MKPinAnnotationView – animatesDrop property cannot be used for custom images.