我在创建的所有单元格顶部都有黑色视图,当用户点击特定单元格时,其alpha将转至0.0f。无法选择正确单元格的正确内容
我一直在努力的是单元重用标识符,因此当我改变某个单元格的某些内容时,其他单元格的内容也会被编辑,因为它们共享相同的indexPath。
如何访问某个特定单元格的内容?
这是我在做什么 -
UITapGestureRecognizer *videoGesture = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(moveVideoPlayer:)];
[self.optionView addGestureRecognizer:videoGesture];
-(void)moveVideoPlayer:(UITapGestureRecognizer *)tap {
CGRect visibleRect = (CGRect){.origin = self.tableView.contentOffset, .size = self.view.bounds.size};
CGPoint visiblePoint = CGPointMake(CGRectGetMidX(visibleRect), CGRectGetMidY(visibleRect));
NSIndexPath *visibleIndexPath = [self.tableView indexPathForRowAtPoint:visiblePoint];
self.visibleIndex = (int)visibleIndexPath.row;
SearchCell *cell = (SearchCell *)[self.tableView cellForRowAtIndexPath:visibleIndexPath];
NSLog(@"object ID : %@",cell.objectId);
cell.greyView.alpha = 0.0f;
}
UITapGesture的什么需求? table view didSelect方法已经存在 –