Thursday, 15 August 2013

Passing 2 parameters into UIButton's action function

Passing 2 parameters into UIButton's action function

I have a UIButton. My
-(void)backBtn:(NSString *)parentId lbltext:(NSString *)label
function will be fired when push the button.
[button addTarget:self
action:@selector(backBtn:lbltext:)
withObject:par
withObject:title.text
forControlEvents:UIControlEventTouchDown];
I looked this question. But my fired function will change my button name,
depends some functions with the parameters. So I can't create another
class.
How can I make this code true?Thanks.

No comments:

Post a Comment