我刚刚添加了一个UITapGestureRecognizer
到我的UITableView
,但处理程序(下)只是给 'null' 为indexPath
.
- (void)photoTapped:(UIGestureRecognizer *)gestureRecognizer {
if (gestureRecognizer.state == UIGestureRecognizerStateEnded) {
CGPoint tapLocation = [gestureRecognizer locationInView:self.itemsTableView];
NSIndexPath *tappedIndexPath = [self.itemsTableView indexPathForRowAtPoint:tapLocation];
//...
}
}
我不明白为什么。