开发者

Should I remove or hide my annotations in MKMapView?

开发者 https://www.devze.com 2023-03-30 07:22 出处:网络
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 use

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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消