I\'m testing out the MapKit framework on the iPhone and would really much like to switch the standard pin that displays a location to an image called \"location.png\".
I solved it after looking at the source for MapCallouts
Here is my solution:
- (MKAnnotationView *)mapView:(MKMapView *)map viewForAnnotation:(id )annotation
{
static NSString *AnnotationViewID = @"annotationViewID";
MKAnnotationView *annotationView = (MKAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:AnnotationViewID];
if (annotationView == nil)
{
annotationView = [[[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:AnnotationViewID] autorelease];
}
annotationView.image = [UIImage imageNamed:@"location.png"];
annotationView.annotation = annotation;
return annotationView;
}