MKMapView Clicking on pins won't call didSelectAnnotationView
Asked Answered
P

1

6

I am using a mapView and am trying to make a callout pop up when you click on a pin which is shown on the map.

The pins manage to be placed in the proper locations so I think the annotations work but when I click on the pin it won't show a callout. I have show callout = YES.

The method didSelectAnnotationView does not get called at all when I click on the pin.

Are there some common problems which may cause this method not to be called?

Parental answered 11/8, 2012 at 0:25 Comment(0)
B
23

If tapping on a pin doesn't show the callout even if canShowCallout is YES, then the annotation's title is probably nil or blank.

If the title is blank, the callout won't show nor will the didSelectAnnotationView delegate method get called.

Boatright answered 11/8, 2012 at 1:26 Comment(3)
Yup turns out I wasnt setting the title of my annotation properly and hence it wasnt working, thanksParental
after so much search, saw ur answer, then had a look at the custom annotation object only name was a weak property by mistake and i was like blasting, thanksFalzetta
this is an annoying behaviour of MKMapView - thanks for the heads up :)Litharge

© 2022 - 2024 — McMap. All rights reserved.