UITapGestureRecognizer
을 왜 사용하고 있습니까? 이를 사용하려면 레이블 태그를 label.tag=indexpath.row
으로 설정하십시오. 그래서 당신은 당신이보고있는 가치를 얻을 수 있습니다. 내 자신의 의견에 대해서는, 나는 uitapgesturerecognizer
를 제거하고 직접 didselectrowatindexpath
방법 ..
편집 2 사용하십시오 :
이
.. 당신을 도울 수있는이 solution..it를 사용해보십시오
-(void)handleTap:(UITapGestureRecognizer *)sender
{
CGPoint location = [sender locationInView:self.view];
if (CGRectContainsPoint([self.view convertRect:self.yourTableView.frame fromView:self.tableView.superview], location))
{
CGPoint locationInTableview = [self.yourTableView convertPoint:location fromView:self.view];
NSIndexPath *indexPath = [self.yourTableView indexPathForRowAtPoint:locationInTableview];
if (indexPath)
[self tableView:self.yourTableView didSelectRowAtIndexPath:indexPath];
return;
}
}
내가 이상을 사용을 하나의 레이블보다 –
UITapGestureRecognizer를 사용하여 무엇을 할 예정입니까 ?? –
레이블을 탭하면 어레이에 다른 값을 저장하고 어레이 인덱스로 선택한 행이 필요합니다. –