void TableView::_moveCellOutOfSight(TableViewCell *cell)
{
if(_tableViewDelegate != nullptr) {
_tableViewDelegate->tableCellWillRecycle(this, cell);
}
_cellsFreed.pushBack(cell);
_cellsUsed.eraseObject(cell);
_isUsedCellsDirty = true;
_indices->erase(cell->getIdx());
cell->reset();
if (cell->getParent() == this->getContainer())
{
this->getContainer()->removeChild(cell, true);;
}
}
格子加到空闲数组, 但后来双调用removeChild从父节点删除了,还能用吗?
既然要加到空闲数组,在需要时可以复用,可是为什么后来要调用删除removeChild? 这样不是不用用了么