美文网首页
分区头按钮点击事件获取当前cell

分区头按钮点击事件获取当前cell

作者: Tanyfi | 来源:发表于2016-12-01 16:13 被阅读8次

    项目需求, 在tableView的分区头视图, 获取tableViewcell 记住 superview的使用

    ShoppingCell *cell = (ShoppingCell *)[btn superview].superview.superview;
        
        NSIndexPath *p = [_tableView indexPathForCell:cell];
    
        NSIndexSet *indexSet = [NSIndexSet indexSetWithIndex:p.row];
        
        [self.tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic];
    

    相关文章

      网友评论

          本文标题:分区头按钮点击事件获取当前cell

          本文链接:https://www.haomeiwen.com/subject/eogxmttx.html