iphone - How do I load different custom pins or identifiers based off of their property values? -
I have objects that are Method: I have loaded each PIN using a custom image: However, I do not want all the pins to be loaded with this image. How do I do this If you have a few custom properties in your object which corresponds to Make sure the annotation view is dequeued or created or not regardless of the & lt; MKAnnotation & gt; . I load this array in my annotations using the annotation:.
- (MKAnnotationView *) mapView: (MKMapView *) mapView viewForAnnotation: (id & lt; MkAnnotation & gt;) Annotation < / Pre>
annotation view. Image = [UIImage imageNamed: @ "purp_pin.png"];
MKAnnotation , in a way you can image To set it, access it in
viewForNnotation :
MyAnnotationClass * myAnnot = (MyNnotationClass *) annotation; If (myAnnot.someProperty == 42) Annotation View.image = [UIImage imageNamed: @ "purp_pin.png"]; Other annotations View.image = [UIImage imageNamed: @ "default.png"];
image property is set.
Comments
Post a Comment