Ios7 映射自定义批注未显示在设备中

Ios7 映射自定义批注未显示在设备中,ios7,mkmapview,mkannotation,mkannotationview,mkmapviewdelegate,Ios7,Mkmapview,Mkannotation,Mkannotationview,Mkmapviewdelegate,我正在通过以下代码更改pin注释视图: -(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation { if([annotation isKindOfClass:[MKUserLocation class]]) return nil; static NSString *identifier=@"myAnnotation

我正在通过以下代码更改pin注释视图:

-(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation {

    if([annotation isKindOfClass:[MKUserLocation class]])
        return nil;
    static NSString *identifier=@"myAnnotation";

    MapObjects *annotation1=(MapObjects*)annotation;
    MKPinAnnotationView * annotationView = (MKPinAnnotationView*)[self.map_whereAreVehicles dequeueReusableAnnotationViewWithIdentifier:identifier];
    if(!annotationView){
        annotationView= [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:nil];
        annotationView.image=[UIImage imageNamed:@"greenpin.png"];
        annotationView.animatesDrop = NO;

        annotationView.canShowCallout = NO;
    }
    else{
        annotationView.annotation=annotation;
    }
    return annotationView;
}
-(MKAnnotationView*)地图视图:(MKMapView*)地图视图注释:(id)注释{
if([annotation isKindOfClass:[MKUserLocation类]])
返回零;
静态NSString*标识符=@“myAnnotation”;
MapObjects*注释1=(MapObjects*)注释;
MKPinAnnotationView*annotationView=(MKPinAnnotationView*)[self.map\u wherereveehicles dequeuereusableannotationview with identifier:identifier];
如果(!annotationView){
annotationView=[[MKPinAnnotationView alloc]initWithAnnotation:annotation重用标识符:nil];
annotationView.image=[UIImage ImageName:@“greenpin.png”];
annotationView.animatesDrop=否;
annotationView.canShowCallout=否;
}
否则{
annotationView.annotation=注释;
}
返回注释视图;
}

这是在模拟器中向我显示图像。但当我在ipad上测试时,它并没有显示任何东西。如果我删除图像,则默认pin会显示在这两个文件中。设备注释中还有一个内容,但它不仅是可见的。

可能问题在于您的文件名。模拟器不区分大小写,设备不区分大小写。请确保使用了正确的文件名