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

2016-12-01  本文已影响8人  Tanyfi

项目需求, 在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];
上一篇下一篇

猜你喜欢

热点阅读