在我的代码中,我必须将两个参数传递给 targetMethod printMethod
,我可以将 button.tag 作为一个参数传递,以及如何传递另一个参数?
请举个例子。
我的代码:
button.tag = indexPath.row;
secondArgument = indexPath.section;
[button addTarget:self action:@selector(printMethod:) forControlEvents:UIControlEventTouchUpInside];
-(IBAction)printMethod:(UIButton*)sender{
NSLog(@"%d%d",sender.tag,//SecondArgument);
}