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

来源:互联网 发布:族谱软件哪个好 编辑:程序博客网 时间:2024/05/16 15:55

在设置的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
0 0
原创粉丝点击