0

I have seen the answer to this question.

However, I have a page where I add many custom map annotations to a map, and I need to know which AnnotationView's rightCalloutAccessoryView (a UIButton in my case) was pressed.

The ideal would be to set a custom ID attribute on the button. But seeing as I can't find a mechanism to do that, I guess it's not the way.

Community
  • 1
  • 1
Ovesh
  • 5,209
  • 11
  • 53
  • 73
  • 2
    If you're using an MKMapView, the calloutAccessoryControlTapped delegate method is probably the best way to respond to the button press instead of creating your own action method. The delegate method passes the annotation view as one of it's parameters (and the view also has the annotation itself as one of its properties). –  Feb 13 '11 at 21:39

3 Answers3

2

UIView object has a tag property you can freely set and read. You may find this is useful.

MHC
  • 6,405
  • 2
  • 25
  • 26
0

when you declare your button action method like this: yourMethod:(id)sender you will receive a pointer to the button(or whatever object) which called the action, in the sender var

JonLOo
  • 4,929
  • 1
  • 19
  • 27
-1

I think some of these answers might help.

Community
  • 1
  • 1
Abizern
  • 146,289
  • 39
  • 203
  • 257