1
(MKAnnotationView *) mapView:(MKMapView *)theMapView
viewForAnnotation:(id <MKAnnotation>)annotation
{
if ([annotation isKindOfClass: [MyLocation class] ])
{
MKPinAnnotationView *annotationView = (MKPinAnnotationView *) [theMapView dequeueReusableAnnotationViewWithIdentifier:placemarkIdentifier];
if(annotationView == nil)
{
annotationView = [[MKPinAnnotationView alloc]initWithAnnotation:annotation reuseIdentifier:placemarkIdentifier];
}
else
{
annotationView.annotation = annotation;
}
annotationView.enabled = YES;
annotationView.animatesDrop = NO;
annotationView.pinColor = MKPinAnnotationColorPurple;
annotationView.canShowCallout = YES;
annotationView.draggable = YES;
return annotationView;
}
}
[MKAnnotationView setAnimatesDrop:]:
发送到实例的无法识别的选择器。 我使用了一些注解类(MKPinAnnotationView和MKAnnotationView)。可能是因为使用了dequeueReusableAnnotationViewWithIdentifier而发生此错误。[MKAnnotationView setAnimatesDrop:]:无法识别的选择器发送到实例。但为什么?