如何从下面的方法获取新的位置

Gau*_*rav 2 iphone mapkit mkannotation ios

-(void)mapView:(MKMapView *)mapView 
    annotationView:(MKAnnotationView *)view                  
    didChangeDragState:(MKAnnotationViewDragState)newState 
    fromOldState:(MKAnnotationViewDragState)oldState
Run Code Online (Sandbox Code Playgroud)

D_D*_*D_D 6

你使用这个:

- (void)mapView:(MKMapView *)mapView 
        annotationView:(MKAnnotationView *)annotationView 
        didChangeDragState:(MKAnnotationViewDragState)newState 
        fromOldState:(MKAnnotationViewDragState)oldState 
{
    if (newState == MKAnnotationViewDragStateEnding)
    {
        CLLocationCoordinate2D droppedAt = annotationView.annotation.coordinate;
        NSLog(@"dropped at %f,%f", droppedAt.latitude, droppedAt.longitude);
    }
}
Run Code Online (Sandbox Code Playgroud)

这将为您提供MKAnnotationView丢弃时最终位置的坐标.