I have a detailDisclousure
button on the callout of a MKAnnotation
. When this button is pressed I need to call a method passing a parameter that identi
you can pass any NSInteger
via the tag
property of the UIButton
only.
I think you can add a property(which is (Annotation *)annotation) in .h file. Then you can use annotation in the "-(void)goToViewWithAnnotation" method. Or you can customized a new button which inherits UIControl
It's not possible to send data with the -addTarget:action:forControlEvent:
for UIButton
:
[detailButton addTarget:self action:@selector(goToViewWithAnnotation:) forControlEvents:UIControlEventTouchUpInside];
Try to handle the data with some other way, when you trigger the selector. Like saving a pointer or var as you like.
UIButton
have these callers as you can see:
- (void)action
- (void)action:(id)sender
- (void)action:(id)sender forEvent:(UIEvent *)event