In my viewWillAppear for a view I have
MKPointAnnotation *point = [[MKPointAnnotation alloc] init];
[point setCoordinate:(myLocation)];
[point setTitle:@"Here it is!"];
[mapView addAnnotation:point];
[mapView setRegion:adjustedRegion animated:YES];
This adds the point to the map as I intend. However I have to tap it in order to see the callout.
How can I have it show the callout by default?
I tried adding this right after:
[self.mapView selectAnnotation:annotation animated:YES];
But it didn't seem to work... do I have to use a real annotation and not a MKPointAnnotation to do this?
You named your annotation point
not annotation
:
[mapView selectAnnotation:point animated:YES];
It happens to the best of us.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With