modded again to avoid mem leakz:
Code:
- (MKAnnotationView *)mapView:(MKMapView *)aMapView viewForAnnotation:(id <MKAnnotation>)anAnnotation
{
MKPinAnnotationView *pin = (MKPinAnnotationView *) [mapView dequeueReusableAnnotationViewWithIdentifier: @"StartPin"];
if (pin == nil)
{
if ([anAnnotation isKindOfClass:[MapAnnotation class]])
{
MapAnnotation *theAnnotation = (MapAnnotation *)anAnnotation;
if (theAnnotation.identifier == @"StartAnnotation")
{
MKPinAnnotationView *startAnnotationPin = [[MKPinAnnotationView alloc] initWithAnnotation:anAnnotation reuseIdentifier:@"StartPin"];
startAnnotationPin.pinColor = MKPinAnnotationColorGreen;
return startAnnotationPin;
}
}
}
return nil;
}