我有一个自定义方法来检测单元格图像上的点击。我还想找到图像相关单元格的索引路径,并在函数中使用它。这是我正在使用的:
CellforRowAtIndexPath:
UITapGestureRecognizer *tapped = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(cellImageTapped:)];
tapped.numberOfTapsRequired = 1;
[cell.imageView addGestureRecognizer:tapped];
我试图在以下位置获取索引路径的方法:
-(void)cellImageTapped:(id)sender {
if(videoArray.count > 0){
Video *currentVideo = [videoArray objectAtIndex:INDEX_PATH_OF_CELL_IMAGE];
//do some stuff
}
}
我不知道如何传递索引路径。有任何想法吗?