- 为MKAnnotation的coordinate赋值后,设置
[self.mapView selectAnnotation:self.annotation animated:YES];
才能显示标注
- (void)longPress:(UILongPressGestureRecognizer *)longPress
{
if (longPress.state == UIGestureRecognizerStateBegan)
{
CGPoint point = [longPress locationInView:self.mapView];
CLLocationCoordinate2D coordinate = [self.mapView convertPoint:point toCoordinateFromView:self.mapView];
[self.mapView deselectAnnotation:self.annotation animated:YES];
self.annotation.coordinate = coordinate;
[self.mapView selectAnnotation:self.annotation animated:YES];
}
}
}