- (MKAnnotationView *)mapView:(MKMapView *)mapView
viewForAnnotation:(id <MKAnnotation>)annotation {
if(annotation == yourFirstAnnotation)
{
MKPinAnnotationView *annView=[[MKPinAnnotationView alloc] initWithAnnotation:yourFirstAnnotation reuseIdentifier:[annotation title]];
annView.pinColor = MKPinAnnotationColorRed;
annView.animatesDrop=NO;
annView.canShowCallout = YES;
return [annView autorelease];
}
else
if(annotation == yourSecondAnnotation)
{
MKPinAnnotationView *annView=[[MKPinAnnotationView alloc] initWithAnnotation:yourSecondAnnotation reuseIdentifier:[annotation title]];
annView.pinColor = MKPinAnnotationColorGreen;
annView.animatesDrop=NO;
annView.canShowCallout = YES;
return [annView autorelease];
}
}
Я думаю, если это не сработает, используйте isEqual:
вместо ==
.