gpt4 book ai didi

ios - 如何删除所有注释图钉然后添加一个新图钉

转载 作者:行者123 更新时间:2023-12-01 17:43:17 26 4
gpt4 key购买 nike

好奇是否有人可以帮助做一件事:

我只是想告诉 Xcode,如果 map 上同时存在“addAnnotation”和“newAnnotation”引脚,则删除初始的“newAnnotation”引脚。

我的非工作代码如下:

if ([self.mapView addAnnotation:addAnnotation] & [self.mapView addAnnotation:newAnnotation] return)
{
[self.mapView removeAnnotation:newAnnotation];
}

谢谢!

最佳答案

感谢您的反馈,但我解决了这个问题:

NSArray *existingpoints = mapView.annotations;

if ([existingpoints count])
[mapView removeAnnotations:existingpoints];

关于ios - 如何删除所有注释图钉然后添加一个新图钉,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13058621/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com