MKAnnotationView Image Property

I have a MKAnnotationView property ( draggable set to YES ) with a custom image set via the image property. When an annotation is added to a map, it has a custom image. But when the annotation returns, the image reverts to the default value. I also tried to overwrite the image property every time the dragState changes. No luck here either.

+4
source share
2 answers

You are using an MKPinAnnotationView instance instead of using an MKAnnotationView instance.

+5
source

You should use MKAnnotationView , not MKPinAnnotationView . Also consider my answer to your other question regarding drag and drop. Pretty cool stuff.

An MKPinAnnotationView is a ready-made annotation view, just like MKPointAnnotation is a concrete implementation of the MKAnnotation protocol.

These two classes can be used together for fast, custom results.

I suggest that you can use MKPinAnnotationView , which will always use output by default, as the life cycle begins.

0
source

All Articles