Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reload or Refresh the MKMapView based on the different preferences or sort types

I have an application where the map view has several pins and annotations. These pins should refresh or reload based on the various sort options I have on my view. e.g. The pins represent various buildings, and the filter options are like, Library, Museum, Movie Theater, All Attractions, etc.

I have tried using

[MapView reloadInputViews];

based on the filtered array after choosing an option. But it simply does not work for me. Any ideas how this would be implemented? Thanks in advance!

like image 801
Apple_iOS0304 Avatar asked Jan 07 '13 06:01

Apple_iOS0304


1 Answers

Use [MKMapView removeAnnotations:] and [MKMapView addAnnotation:] to change the pins that are on the map.

like image 159
Craig Avatar answered Nov 15 '22 14:11

Craig