我遇到了 MapKit 代表的异常行为
-(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation (id<MKAnnotation>)annotation
{
MKAnnotationView *annotationView=[mapView viewForAnnotation:annotation];
return annotationView;
}
当我将注释添加到mapkit并将setdelegate添加到self时,不会调用此方法。但是当我将区域设置为
MKCoordinateRegion viewRegion = MKCoordinateRegionMakeWithDistance(coordinate, 7.5*1609.344 ,7.5*1609.344 );
[productsMapView setRegion:viewRegion animated:YES];
然后调用委托方法。我不知道为什么会这样。有人帮助