//通过这个方法可以根据cell上的控件找对指定cell
- (UITableViewCell *)cellForRowAtIndexPath:(NSIndexPath *)indexPath
// 根据frame获取对应cell
- (void)didTapButton UIButton *)sender
{
CGRect buttonRect = sender.frame;
for (CustomCell *cell in [self.baseTableView visibleCells])
{
if (CGRectIntersectsRect(buttonRect, cell.frame))
{
//cell就是所要获得的
}
}
}
{
CGRect buttonRect = sender.frame;
for (CustomCell *cell in [self.baseTableView visibleCells])
{
if (CGRectIntersectsRect(buttonRect, cell.frame))
{
//cell就是所要获得的
}
}
}
// 获取控件所在cell的row
UITableViewCell * cell = (UITableViewCell *)[[widget superview] superview];
NSIndexPath * path = [self.baseTableView indexPathForCell:cell];
NSIndexPath * path = [self.baseTableView indexPathForCell:cell];