Should I remove or hide my annotations in MKMapView?

妖精的绣舞 提交于 2019-12-23 09:55:34

问题


I was wondering which would be faster/more efficient when it comes to taking off annotations from the map: hiding or removing. I need to remove and add 100 or so pins every time the user zooms in or out.

I can either loop through and hide all annotations using setHidden:, or just remove them using removeAnnotations:. I'm not sure which would be a better method.


回答1:


I believe the standard method is to remove them. Less memory overhead. Not that 100 takes up that much, but still better to remove and re-add when needed then to hide.



来源:https://stackoverflow.com/questions/7163841/should-i-remove-or-hide-my-annotations-in-mkmapview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!