Is it better in terms of memory management, battery life and processor usage to remove currently not visible MKAnnotations from MKMapView or not?
I’m talking about BIG amounts of annotations (say ~1000) with only about 20 visible in current region at any given time. Should I let MapKit do his job with hiding of pins or should I handle adding/removing of annotations depending on visible region myself?
The annotations that are offscreen will not cause a large memory usage.
MKAnnotationis designed to be very lightweight and you should try to keep them small. The memory hog is the associated view (theMKAnnotationView). If you have more than a few hundred visible it will cause a slowdown and large memory use with a possible crash on older devices. 1000 will slow down any device but probably won’t crash it.To sum up, the offscreen annotations don’t matter. The problems arise when you have too many onscreen. For that you have to remove annotations to get better performance. How you decide to remove and replace annotations is a much more difficult question.