我刚刚给我的
我不明白为什么。
UITableView
添加了一个UITapGestureRecognizer
,但是下面的处理程序返回indexPath
为“null”。
- (void)photoTapped:(UIGestureRecognizer *)gestureRecognizer {
if (gestureRecognizer.state == UIGestureRecognizerStateEnded) {
CGPoint tapLocation = [gestureRecognizer locationInView:self.itemsTableView];
NSIndexPath *tappedIndexPath = [self.itemsTableView indexPathForRowAtPoint:tapLocation];
//...
}
}
我不明白为什么。
UICollectionView
,完美地运行了! - Sheharyar