【发布时间】:2012-01-10 11:00:31
【问题描述】:
我发现 tableview 何时被 UIPinchGestureRecognizer 在cellForRowAtIndexPath 声明。现在想要找到被捏住的特定单元格的 indexPath。所以我写了这样的......
- (void)pinchDetected:(UIPinchGestureRecognizer*)gestureRecognizer {
CGPoint p = [gestureRecognizer locationInView:tblAccountsList];
NSIndexPath *indexPath = [tblAccountsList indexPathForRowAtPoint:p];
NSLog(@"indexPath.row = %@", indexPath.row);
UITableViewCell *pinchedCell = [tblAccountsList cellForRowAtIndexPath:indexPath];
NSLog(@"pinchedCell = %@", pinchedCell);
}
问题出在 indexPath.row 和单元格中,这两种情况的值都是 null。
所以,请有人帮我找到被夹住的 indexPath 或行。
【问题讨论】:
-
CGPoint p获得了什么价值?
标签: iphone uitableview row pinch nsindexpath