Tutorial :How to remove annotations added as MKAnnotationView objects



Question:

I am new to using MapKit framework.

I am adding an image to MKAnnotationView object at specific lat-long pair on map, say at (latA, longA).

For the next iteration, i need to remove the annotation added and add new annotation at different lat-long pair, say at (latB, longB).

Let me know of any help.

Thanks @dity@


Solution:1

Step1: Remove the annotation [self.mapView removeAnnotation:annotation];

Step2: Change/Recreate the annotation, and add it back [self.mapView addAnnotation:annotation]


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »