相关疑难解决方法(0)

如何在不删除蓝点的情况下从MKMapView中删除所有注释?

我想从我的mapview中删除所有注释,而不是我的位置的蓝点.我打电话的时候:

[mapView removeAnnotations:mapView.annotations];
Run Code Online (Sandbox Code Playgroud)

删除所有注释.

如果注释不是蓝点注释,我可以通过哪种方式检查(如所有注释的for循环)?

编辑(我用这个解决了):

for (int i =0; i < [mapView.annotations count]; i++) { 
    if ([[mapView.annotations objectAtIndex:i] isKindOfClass:[MyAnnotationClass class]]) {                      
         [mapView removeAnnotation:[mapView.annotations objectAtIndex:i]]; 
       } 
    }
Run Code Online (Sandbox Code Playgroud)

iphone mkmapview mkannotation

26
推荐指数
5
解决办法
3万
查看次数

标签 统计

iphone ×1

mkannotation ×1

mkmapview ×1