Remember that there was a problem a long time ago, about the cell overlap problem, now review and summarize.
TableView cell display in iOS will consume memory, if you want to display countless cells, it is not possible to store each cell, in order to solve this problem, the cell uses a reuse mechanism, the number of cells per display in TableView is limited, The number of cells is able to display the maximum number of cells, when more than the maximum number of cells can be displayed, will be reused before the cell created, there is a cell overlap problem, such as the creation of the first Cell,cell inside a label, when reused to this cell, If the label is not realistic, the cell overlap may occur.
Workaround:
Each of the 1.cell identifiers is different. Although the problem is solved, the memory consumption is huge.
NSString *cellidentifier = [NSString stringwithformat:@ "cell%d%d", [Indexpath section], [Indexpath row]];// Uniquely identify the cell with Indexpath.
2. Delete all the sub-views below the cell.
if (cell = = nil) {
cell = [[UITableViewCell alloc] Initwithstyle:uitableviewcellstyledefault reuseidentifier:cellidentifier];
}
Else
{
Delete all child views of a cell
while ([Cell.contentView.subviews lastobject]! = nil)
{
[(uiview*) [Cell.contentView.subviews Lastobject] removefromsuperview];
}
}
//... Other code
}
ios-on the overlap of cells