If I keep a fixed UITableViewCell
with reuseidentifier=nil
as an ivar and return this instance for a specific row, and then reload this row specifically using [tableView reloadRowsAtIndexPaths:withRowAnimation:]
, the row contents disappear (or sometimes flicker). When I scroll away and back, it becomes visible again. If I do [tableView reloadData]
on the other hand, it will not disappear.
Here is a sample project: https://github.com/hannesoid/HOTableViewTests
I tested this on iOS 6. I know that manually reusing a UITableViewCell in such a way (with out reuseidentifier & dequeueing) is not typically recommended, but in some quite static scenarios it would simplify things.
UITableView is optimized by Apple so that it uses a reasonably small amount of memory and yet still has good performance for when cells appear on the screen. When you do something non-standard like this, and circumvent the optimization, you throw the whole machine out of whack. Here's what I suggest. If you have one specific row that you're now holding as an instance variable, why not simply try giving it a unique name for its reuseIdentifier? Let the kit work it out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With