MKPointAnnotation - default show name and animated?

In my view, WillAppear for viewing 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 a point to the map, as I suppose. However, I have to click it to see the leader.

How can I display the default leader?

I tried to add this right after: [self.mapView selectAnnotation:annotation animated:YES];

But that didn't work ... do I need to use a real annotation, not MKPointAnnotation for this?

+6
source share
2 answers

You named your annotation point not annotation :

  [mapView selectAnnotation:point animated:YES]; 

It happens to the best of us.

+15
source

swift 3

remind this action after adding.

 mapView.addAnnotation(point) mapView.selectAnnotation(point, animated: true) 
0
source

Source: https://habr.com/ru/post/909761/


All Articles