Search code examples
iphoneiosuitableviewrecycle

temporarily prevent a UITableViewCell from being recycled


My UITableViewCells can accept input of data. While working in one cell, it would be perfectly natural for the user to want to scroll up, check something in another cell, then return to the first cell and continue the data entry.

The problem is that this will frequently cause the UITableView to recycle the cell, which wreaks havoc in my program.

Is there any way to temporarily tell iOS not to recycle the cell?

Once the data entry is done, I am fine if it is recycled.

I should add that the data entry uses a custom keyboard. So first responder status is not an issue.


Solution

  • As Chiefly Izzy said, it's not a common way to work. And going against the way the lists work may cause problems. If you want to reduce your problem, keep the content of your cell in memory and use this saved content to refill the cell when willDisplayCell is called instead of rebuilding the whole thing from start each time.