我有下一个自定义单元格:
当我填满我的桌子时,我会这样做:
UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapDetected)];
singleTap.numberOfTapsRequired = 1;
cell.iboPopImage.userInteractionEnabled = YES;
[cell.iboPopImage addGestureRecognizer:singleTap];
我将点击事件添加到这个突出显示的小图像中。
这是函数事件:
我想将单元格索引传递给它,所以我可以使用所需的单元格进行操作
-(void)tapDetected:(NSInteger *)index
{
//Some code to do
}
但它不允许我这样写:
UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapDetected:indexPath.row)];
如何解决?