MKMapView removeAnnotation不删除选定的注释 [英] MKMapView removeAnnotation is not removing the selected annotation

查看:93
本文介绍了MKMapView removeAnnotation不删除选定的注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我调用removeAnnotation并将其传递给我添加的注释的指针时,它并没有删除该注释...这是因为在添加注释时它已经复制了注释吗?

When I call removeAnnotation and pass it a pointer to the annotation I had added, it is not removing the annotation... Is this because it had made a copy of the annotation when I added it?

谢谢 消灭

推荐答案

您可以尝试

nsarray *oldAnnotations=[self.mapview annotations];
[self.mapview removeAnnotations:oldAnnotations];

这篇关于MKMapView removeAnnotation不删除选定的注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆