开发者

Does it affect map loading speed/performance? addAnnotation vs. addAnnotations

I know that both of these two functions work with multiple points on my map view - I can either loop through a set of pins and do an addAnnotation:pin on each one, or I can set up an array and use the addAnnotations:arrayOfPins method...

But I'm wondering, since I wi开发者_高级运维ll often have the program add a new annotation, and sometimes sets of a few, would it be okay to just use addAnnotation:pin in a function, and loop through a set of, say, 30 or 40 pins, then keep using that function for adding new pins elsewhere, rather than have that function, plus a function to load in an array of pins?

Basically, is looping through a bunch of addAnnotation calls for everything noticably slower and/or dumber than using addAnnotation for single annotations, and addAnnotations for sets of annotations?

It's not a huge issue, I just didn't know if using the array function was any better in any way?


In my own testing, with a small set of some 200 pins, it doesn't look like either is faster. I'm going to simply use one function that adds one annotation at a time, and loop through adding annotations via another function, since that will make my code a little simpler.

But either way is probably just as easy.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜