您的位置:首页 > 移动开发 > IOS开发

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

2015-12-30 22:19 531 查看
在设置的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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息