我想从我的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)