ios:点击tablecell中的一个按钮,确定cell所在的行

来源:互联网 发布:车载cd刻录软件 编辑:程序博客网 时间:2024/05/03 09:56


在设置的BUTTON的selector的方法中如下设置:

- (void)button:(id)sender {
    UITableViewCell * cell = (UITableViewCell *)[[sender superview] superview];
    NSIndexPath * path = [self.tableView indexPathForCell:cell];
    NSLog(@"index row%d", [path row]);
}
- (void)button:(id)sender;方法是我设置的button的selector
原创粉丝点击