Quote:
Originally Posted by lxLionHartxl
MKPinkAnnotationView *pin = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:[annotation title]];
pin.animatesDrop = YES;
pin.canShowCallout = YES;
pin.draggable = YES;
continue your coding from there forth
|
Huh. Our company's navigation app is written to support iOS 3.0 (The soon-to-be-released update will move that up to 3.2). Thus I had to implement pin dragging without that property, which was added in iOS 4. I didn't know about it though, since I never revisited that code since our approach works.
The way I did it was to create a custom subclass of MKAnnotationView that implements touchesBegan/touchesMoved/touchesEnded. In those methods I figure out the change in location, and update the annotation object on touchesEnded.
To the OP, note that the docs on the draggable property say:
Quote:
|
Setting this property to YES makes an annotation draggable by the user. If YES, the associated annotation object must also implement the setCoordinate: method. The default value of this property is NO.
|