Remove manually annotation from MKMapView

Hello everyone.


I would like to remove manually annotation from MKMapView.

I add two annotations using the addAnnotation: ([self.mapView addAnnotation:item.placemark];)

Then I would like to remove these annotations manually as following:

[self.mapView removeAnnotation:self.mapView.annotations[0]];

and

[self.mapView removeAnnotation:self.mapView.annotations[1]];


I do not want to remove both annotations at once using the

[self.mapView removeAnnotations:[self.mapView annotations]];


I would like to keep sometimes the annotation[0] and substitute the annotation[1] with a new one or the opposite.

Is it possible?


Regards,

kalgik


P.S: I am using the

(MKAnnotationView *)mapView:(MKMapView *)mV viewForAnnotation:(id <MKAnnotation>)annotation delegate function.

Replies

As far as I searched it is not possible.

http://stackoverflow.com/questions/12216114/mkmapview-annotations-changing-order-sequence


I tried to store any MKMapView annotation in my NSArray in order to control the sequence of annotations.

But it seems to me that I am still missing something.


If anybody knows alternative ways for this issue, I would really appreciate it.


Reagrds,