My first idea is not to do this. But if I had to do this, I would try to create cells using the old dequeue style, and to create the original pool of reusable cells, manually extracting them from nib.
So, do not register cells in a cell or cell, and then in cellForRowAtIndexPath ...
NSString *identifier;
NSInteger index;
if (indexPath.row % 2 == 0) {
identifier = @"oneImageTableViewCell";
index = 0;
} else {
identifier = @"twoImageTableViewCell";
index = 1;
}
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
if (!cell) {
NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"ImageTableViewCell" owner:self options:nil];
cell = topLevelObjects[index];
}
return cell;
source
share