通过tag值获得相应的控件 and 在didSeclec方法中获得TableView中得相应cell

1、通过tag值获得相应的控件

UIButton *btn = (UIButton *)[self viewWithTag:currentIndex];

通过tag值递归搜索当前self的View上的所有控件,包括自身

2、didSeclec方法中获得TableView中得相应cell

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [self tableView:tableView cellForRowAtIndexPath:indexPath];
}
原文地址:https://www.cnblogs.com/tangaofeng/p/4870730.html