Hey all, I got somewhat of a dense question about the mapKit for the iPhone.
I'm using the MapKit framework and what I'm trying to do is basically click a pin, reload it and then show it's callOut after it has been added again.
This is the code I'm trying to get to work..
-(void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view{
NSLog(@"count of selected Annotations: %d",[mapView selectedAnnotations].count);
MKAnnotation* pin = view.annotation;
[mapView deselectAnnotation:pin animated:FALSE];
[mapView removeAnnotation:pin];
[mapView addAnnotation:pin];
[self.mapView selectAnnotation:pin animated:TRUE];
A few observations: If I comment the removeAnnotations and addAnnotation lines out, I enter an infinite loop because when I selectAnnotation:pin, the callback (which is this method) is called... otherwise, it isn't, but then what is? why isn't
[self.mapView selectAnnotation:pin animated:TRUE];
being called?
I've already read far too much and broke my head for far too many hours trying to figure this out that an explanation and a fix to my code would be much more helpful than a link.
Thanks in advance. ~Fydo