Why doesn’t this work?
- (void)mapView:(MKMapView *)mapView didAddAnnotationViews:(NSArray *)views {
if (TRACE_LOG) NSLog(@"%s", __FUNCTION__);
[mapView selectAnnotation:[views lastObject] animated:YES];
return;
}
Thanks,
Z@K!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Because you must select annotation object, not the view that corresponds to it.
I’m 100% not sure, but I think the following should work:
If you store your annotations somewhere it might be better to get annotation object you need directly from that storage. Note that all these methods have affect only if you try to select annotation that is currently visible on screen.