Re: Odd NSCache Eviction Behaviour

2011-04-05 Thread Dalmazio Brisinda
On 2011-04-05, at 7:16 PM, Graham Cox wrote: > > On 05/04/2011, at 7:01 PM, Dalmazio Brisinda wrote: > >> Pity. NSCache looked so promising > > > You could roll your own cache class that has the same interface but uses a > LRU algorithm internally. Then if NSCache is updated it would be a dr

Re: Odd NSCache Eviction Behaviour

2011-04-05 Thread Graham Cox
On 05/04/2011, at 7:01 PM, Dalmazio Brisinda wrote: > Pity. NSCache looked so promising You could roll your own cache class that has the same interface but uses a LRU algorithm internally. Then if NSCache is updated it would be a drop-in replacement. The only drawback with it at present (whic

Re: Odd NSCache Eviction Behaviour

2011-04-05 Thread Dalmazio Brisinda
On 2011-04-05, at 2:37 AM, Ken Thomases wrote: > On Apr 4, 2011, at 11:34 AM, Dalmazio Brisinda wrote: > >> 2) The larger issue. The documentation states: >> >> "By default, NSDiscardableContent objects in the cache are automatically >> removed from the cache if their content is discarded, alt

Re: Odd NSCache Eviction Behaviour

2011-04-04 Thread Ken Thomases
On Apr 4, 2011, at 11:34 AM, Dalmazio Brisinda wrote: > 2) The larger issue. The documentation states: > > "By default, NSDiscardableContent objects in the cache are automatically > removed from the cache if their content is discarded, although this automatic > removal policy can be changed. If

Odd NSCache Eviction Behaviour

2011-04-04 Thread Dalmazio Brisinda
Hi all, I've been using an NSCache to store items that should be cached for performance reasons, since they are rather expensive to recreate. Understanding NSCache behaviour is giving me some headaches though. I initialize my NSCache as follows: _cellCache = [[NSCache alloc] init];