标签:
1. 通过叫Point获取
CGPoint correctedPoint = [textField convertPoint:textField.bounds.origin toView:self.tableView];
NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:correctedPoint];
NSLog(@"Button tapped in row %ld", (long)indexPath.row);
2.通过superview获取
UITableViewCell *cell = (UITableViewCell *)[[textField superview] superview];
NSIndexPath *path = [self.mytableView indexPathForCell:cell];
self.text_IndexPath = path.section;
UITableViewCell的两种获取indexPath的方法
标签:
原文地址:http://www.cnblogs.com/xiaoxiaolei/p/4964236.html