0
在我的應用程序中,當我點擊地圖並知道此點的經度和緯度時,我需要先註釋註釋,然後在經度和緯度上都只打印一個標籤,告訴我該怎麼做?如何在xcode中查找mapview的經度和緯度?
我試過下面的代碼,但沒有幫助。
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation
{
static NSString *identifier = @"MyLocation";
if ([annotation isKindOfClass:[PlaceMark class]]) {
MKPinAnnotationView *annotationView = (MKPinAnnotationView *) [myMapView dequeueReusableAnnotationViewWithIdentifier:identifier];
if (annotationView == nil) {
annotationView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:identifier];
} else {
annotationView.annotation = annotation;
}
annotationView.enabled = YES;
annotationView.canShowCallout = YES;
return annotationView;
}
return nil;
}
的http://計算器.com/questions/4806628/is-there-any-way-to-the-lat-long-of-mkmapview-of-touch-position-iphone-sdk – rptwsthi 2013-02-13 07:34:22