views:

26

answers:

1

I'm wondering if the cache of UITableview cells is cleared when a UITableViewController (or subclass) receives a memory warning.

I have a subview in some cells and I'd like to know if it's safe to release them on a memory warning.

A: 

It is an implementation detail that is not known (or I must have missed it) - and it might change from version to version.

If you implement your custom table view cells correctly and use proper memory management (i.e. release your ivars in dealloc), then it really should not matter at all.

If you have references to those subviews elsewhere, this can get very tricky anyway, as you shouldn't assume the cell coming from the cache or not anyway.

Eiko
I've taken a closer look and I'm only accessing the variable in that function, so there's no reason for it to persist outside of it anyway (I think I was doing it to stubbornly avoid an autorelease). I agree it's kind of shady to have references to these subviews as class variables. I am curious what happens to those cached cells though.
blindJesse