MKMapKit中的自定义注释引脚

时间:2013-04-01 19:44:26

标签: xcode map annotations mkmapview

我正在尝试在我的地图上自定义

上的图钉 ColonnineController类中的

-(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id)annotation方法

但它不起作用,我该如何解决?谢谢你的优势!

here's the source code

这里的方法:

-(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id)annotation{
    static NSString * parkingAnnotationIdentifier = @"ParkingAnnotationIdentifier";

    if([ annotation isKindOfClass:[DisplayMap class]]){
        MKAnnotationView *annotationView=[mapView dequeueReusableAnnotationViewWithIdentifier:parkingAnnotationIdentifier];
        if(!annotationView){
            annotationView=[[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:parkingAnnotationIdentifier];
            annotationView.image=[UIImage imageNamed:@"parkingIcon.png"];
        }
        return annotationView;
    }
    return nil;
}

0 个答案:

没有答案
相关问题