我正在使用
样式中的UITableViewCell
对象UITableViewCellStyleSubtitle
(即左侧的图像视图,粗体的文本标签以及详细文本标签下的文本标签)来创建我的表格.现在我需要检测触摸UIImageView
并且还要知道单击图像视图的索引路径/单元格.我试过用
cell.textLabel.text = @"Sometext";
NSString *path = [[NSBundle mainBundle] pathForResource:@"emptystar1" ofType:@"png"];
UIImage *theImage = [UIImage imageWithContentsOfFile:path];
cell.imageView.image = theImage;
cell.imageView.userInteractionEnabled = YES;
Run Code Online (Sandbox Code Playgroud)
但它不起作用.每当点击图像时,都会didSelectRowAtIndexPath:
被调用.我不想创建一个单独的UITableViewCell
并添加自定义按钮.有没有办法检测UIImageView
自己的触摸?