Accessory views contain custom content and are positioned on either side of the annotation title text. If a view you specify is a descendant of the UIControl class, the map view calls this method as a convenience whenever the user taps your view. You can use this method to respond to taps and perform any actions associated with that control. For example, if your control displayed additional information about the annotation, you could use this method to present a modal panel with that information.
So this method handles taps on the accessoryView of the callout not on the callout it self.
Have you set annotationView.canShowCallout = YES in
Is there anyway I could just tap on the pin and then show the details of the location (possibly in subtitle or in text)? The details should only be updated when the pin is tapped.
In my app the pins actually show titles and subtitles. But what I am trying to achieve is when people tap on any particular pin, it will request more info to be displayed. Which means I need to find out when a user tap a pin and which pin is tapped. Then I will use the id stored in that pin to retrieve more info from the web.
Then use leftCalloutAccessoryView or rightCalloutAccessoryView to add a View to the pins Callout View. You can handle touches on the AccessoryView with
In my app the pins actually show titles and subtitles. But what I am trying to achieve is when people tap on any particular pin, it will request more info to be displayed. Which means I need to find out when a user tap a pin and which pin is tapped. Then I will use the id stored in that pin to retrieve more info from the web.
Use first method to get the tap on the annotation, derive your annotation class from the view object, do your operation and show the info. on the screen by un hiding a UIView with labels.
Use first method to get the tap on the annotation, derive your annotation class from the view object, do your operation and show the info. on the screen by un hiding a UIView with labels.
Ok, I got the customised MKAnnotationView working, although it looked weird - instead of one view with title, subtitle and the details, I have the normal MKAnnotationView and a separate rectangle for the details.
Has anyone ever worked out how to have one view and put everything inside that view?