Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MKPointAnnotation - Default show title and animated?

Tags:

ios

ios5

mapkit

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?

like image 518
sayguh Avatar asked Mar 01 '12 16:03

sayguh


1 Answers

You named your annotation point not annotation:

 [mapView selectAnnotation:point animated:YES];

It happens to the best of us.

like image 69
QED Avatar answered Nov 15 '22 01:11

QED