preventing selection on MKPointAnnotation
- by Derek
Is there a way to prevent an annotation in a MKMapView instance from being enabled. In other words, when the user taps the red pin on the map, is there a way to prevent it from highlighting the pin. Right now the pin turns dark when touched...
Edit: I'm using the following code to return the MKPinAnnotationView
// To future MKMapView users - Don't forget to set _mapView's delegate
_mapView.delegate = self;
_annotation = [[MKPointAnnotation alloc] init];
_annotation.coordinate = myLocation;
[_mapView addAnnotation:_annotation];
-(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation{
MKPinAnnotationView *pin = [[MKPinAnnotationView alloc] initWithAnnotation:_annotation reuseIdentifier:@"id"];
pin.enabled = NO;
return pin;
}