我想将一个变量传递给UIButton动作,例如
NSString *string=@"one";
[downbutton addTarget:self action:@selector(action1:string)
forControlEvents:UIControlEventTouchUpInside];
我的行动函数是这样的:
-(void) action1:(NSString *)string{
}
However, it returns a syntax error. How to pass a variable to a UIButton action?