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:]:無法識別的選擇器發送到實例。但爲什麼?