UIControl actions (UIButton - one) can have three different method signatures:
- (void)action - (void)action:(id)sender - (void)action:(id)sender event:(UIEvent *)event
so you're trying to make it impossible. You cannot send a custom object using UIControlEvent.
Perhaps something like this is the solution to your problem.
-(void)buttonInfo:(id)sender { NSString *fileName = nil; if (sender == infobuttonTwo) { fileName = @"VTS_02_1"; } }
and of course you have to change your wrong addTarget method
[infobuttonTwo addTarget:self action:@selector(buttonInfo:) forControlEvents:UIControlEventTouchUpInside];
Matthias bauch
source share