我有一个包含多个变量的方法:
-(void) showImg:(UIBarButtonItem *)sender string1:(NSString *) string2:(NSString *);
我想发送NSString
值(因为这function
用于多个元素)。
这就是我action
在不需要参数时添加的方式:
[myButton addTarget:self action:@selector(showImg) forControlEvents: UIControlEventTouchUpInside];
我尝试在@selector
这样的范围内添加参数:
[myButton performSelector @selector(showImg:string1:string2::) withObject:@"-1" withObject:@"-1"];
但这不起作用。如何function
直接在内部调用带有多个参数的my @selector
?