我有这段代码可以删除并在我的地图中添加一个新图钉:
- (IBAction)setLocation:(id)sender{
NSMutableArray *toRemove = [NSMutableArray arrayWithCapacity:1];
for (id annotation in map.annotations)
if (annotation != map.userLocation)
[toRemove addObject:annotation];
[map removeAnnotations:toRemove];
MKPointAnnotation *annotationPoint = [[[MKPointAnnotation alloc] init]autorelease];
annotationPoint.coordinate = map.userLocation.coordinate;
annotationPoint.title = @"Position";
[map addAnnotation:annotationPoint];
MKPinAnnotationView *pinView = [[[MKPinAnnotationView alloc] initWithAnnotation:annotationPoint reuseIdentifier:@"Pin"] autorelease];
pinView.pinColor = MKPinAnnotationColorRed;
pinView.canShowCallout = YES;
//pinView.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
pinView.animatesDrop = TRUE;
}
但我设置了我的 pin 它不做动画但我设置了 animatesDrop = true,为什么?