The MKAnnotationView
class has an enabled
property (not the id<MKAnnotation>
objects).
To set enabled
on the map view's user location annotation view, get a reference to it in the mapView:didAddAnnotationViews:
delegate method:
-(void)mapView:(MKMapView *)mapView didAddAnnotationViews:(NSArray *)views
{
MKAnnotationView *av = [mapView viewForAnnotation:mapView.userLocation];
av.enabled = NO; //disable touch on user location
}
(In viewForAnnotation
, you have to return nil
to tell the map view to create the view itself so enabled
can't be set there -- at least for the user location.)