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

来源:互联网 发布:购物中心软件下载 编辑:程序博客网 时间:2024/04/30 01:08
在设置的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

相关:http://blog.it985.com/3400.html
0 0