I am trying to get rid of a cached UITableView cell. I have two sections. The first cell of the second section has the same “appearance” as the first cell of the first section. With appearance, I mean cell height (multi-line cells).
I tried to use different identifiers, but that didn't work. Here is the code:
NSString *identifier;
if (thisViewMode) {
identifier = @"thisViewMode";
} else if ((indexPath.section == 1) && thatViewMode) {
identifier = @"thatViewMode";
} else {
identifier = @"CellIdentifier";
}
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
if (cell == nil) {
cell = [self CreateMultilinesCell:identifier];
}
thatViewModeonly called once, which is wrong because I have more cells in the second section. If I change the contents of the first cell in the first section, the height of the first cell in the second section will also change. Usually each cell should have its own cell height, but this is not the case here.
Is there a problem that I cannot use different cell identifiers in the same table view?