你好我有这个方法:
-(void)adresseZeigen
{
NSLog(@"%s",__PRETTY_FUNCTION__);
selectedAnnotation = [[MKPointAnnotation alloc]init];
selectedAnnotation.title = selectedCompanyName;
selectedAnnotation.subtitle = selectedCompanyAdresse;
selectedAnnotation.coordinate = selectedCompanyPoint;
NSLog(@"selected title: %@",selectedAnnotation.title);
NSLog(@"selected subtitle: %@",selectedAnnotation.subtitle);
NSLog(@"selected latitude is: %f", self.selectedAnnotation.coordinate.latitude );
NSLog(@"selected longitude is: %f", self.selectedAnnotation.coordinate.longitude );
[mapView addAnnotation:selectedAnnotation];
MKCoordinateRegion selectedRegion;
selectedRegion.center = selectedCompanyPoint;
selectedRegion.span.longitudeDelta = 0.01;
selectedRegion.span.latitudeDelta = 0.01;
[mapView setRegion:selectedRegion animated:YES];
}
它实际上应该在我的地图视图中给我一个注释。
我的日志输出是:
-[SecondViewController adresseZeigen]
selected title: Company 2
selected subtitle: Company 2 Adresse
selected latitude is: 48.620000
selected longitude is: 9.460000
但不知何故,我没有在地图上得到注释。
有人可以帮帮我吗?