4

I have an MKAnnotationView (draggable property is set to YES) with a custom image, set via the image property. When the annotation is added to the map it has the custom image. But the image turns back to the default pin when the annotation is dragged. I also tried to overwrite the image propery everytime the dragState changes. No luck here also.

iHunter
  • 6,205
  • 3
  • 38
  • 56
Ben Zwak
  • 225
  • 1
  • 3
  • 8

2 Answers2

5

You're using an MKPinAnnotationView instance instead of using an MKAnnotationView instance.

Rodolfo Cartas
  • 136
  • 1
  • 6
0

You should use an MKAnnotationView, not a MKPinAnnotationView. Also consider my answer on your other question regarding dragging. Pretty cool stuff.

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

These two classes could be used together to get quick, uncustomised results.

I believe you may be using MKPinAnnotationView which will always default to a pin as it's lifecycle occurs.

Daniel
  • 23,129
  • 12
  • 109
  • 154