So I have a MKMapView with all my pins added, and the colour of the pin is dependent on whether a value is set for that pin. When I first load the app, viewForAnnotation>
Actually, I dont' know if this worked for you but this is how I did it.
I didn't need to delete the annotation from map. All I need to do is tell the map to give me the annotation view for a parameter annotation. The map will return the correct annotation. From there, I have a property for my custom annotation to identify whether it is an active item, if yes, show the normal pin image, else show full pin image.
-(void)updateAnnotationImage:(CustomAnnotation *)paramAnnotation
{
MKAnnotationView *av = [geoMap viewForAnnotation:paramAnnotation];
if (paramAnnotation.active)
{
av.image = [UIImage imageNamed:@"PinNormal.png"];
}
else
{
av.image = [UIImage imageNamed:@"PinFull.png"];
}
}
Bit late but hopefully it helps others who came across this problem.