点击cell上面的控件获取cell

来源:互联网 发布:redis 持久化数据库 编辑:程序博客网 时间:2024/05/16 06:51

- (void)button:(id)sender {

    UITableViewCell * cell = (UITableViewCell *)[[sendersuperview] superview];

    NSIndexPath * indexPath = [_mTableView indexPathForCell:cell];

    NSLog(@"index row%ld", (long)[indexPathrow]);

    //可以根据indexpath 获取当前的cell。  

    

    UITableViewCell *cell = [tableViewcellForRowAtIndexPath:indexPath];

}


0 0
原创粉丝点击