I am trying to implement a draggable \"pin\" (actually a custom icon) in a map view. This is the delegate code that I have:
-(MKAnnotationView *) mapView:(
Use MKPinAnnotationView
instead of MKAnnotationView
.
MKPinAnnotationView *pin = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:@"purple_pin"];
if (pin==nil)
{
pin = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"purple_pin"];} else {
pin.annotation=annotation;
}
pin.pinColor = MKPinAnnotationColorPurple;
pin.draggable = TRUE;
return pin;