Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 如何通过手势识别TTThumbsViewController中的触摸照片?_Objective C_Three20_Uigesturerecognizer_Ttthumbsviewcontroller - Fatal编程技术网

Objective c 如何通过手势识别TTThumbsViewController中的触摸照片?

Objective c 如何通过手势识别TTThumbsViewController中的触摸照片?,objective-c,three20,uigesturerecognizer,ttthumbsviewcontroller,Objective C,Three20,Uigesturerecognizer,Ttthumbsviewcontroller,我将TTThumbsViewController子类化,以集成上传过程。作为回报,我还想集成一个删除过程 我的情况: 我在单击照片时添加了手势识别器: UILongPressGestureRecognizer* recognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(deleteImag

我将TTThumbsViewController子类化,以集成上传过程。作为回报,我还想集成一个删除过程

我的情况: 我在单击照片时添加了手势识别器:

UILongPressGestureRecognizer* recognizer = [[UILongPressGestureRecognizer alloc] 
                                             initWithTarget:self action:@selector(deleteImage:)];
[self.view addGestureRecognizer:recognizer];

但是使用该代码段,我只识别行,而不是我选择的对象。TTThumbsViewController每个默认值在一行中最多有4个元素

有什么办法吗


向您致意,hijolan

您始终可以使用UIView的hitTest功能

TTThumbView * selectedThumb = [self.tableView hitTest:point withEvent:nil];
if (selectedThumb && [selectedThumb isKindOfClass:[TTThumbView class]]) {
    // Do something with this thumb
}

在接下来的几周里,我将尝试一下,并将这个答案标记为之后的正确答案。我还发现了另一个解决方法,我也将发布它。。。谢谢你的回答,希约兰
TTThumbView * selectedThumb = [self.tableView hitTest:point withEvent:nil];
if (selectedThumb && [selectedThumb isKindOfClass:[TTThumbView class]]) {
    // Do something with this thumb
}