Tuesday, May 7, 2013

NSCache setEvictsObjectsWithDiscardedContent example ios


setEvictsObjectsWithDiscardedContent:

Sets whether the cache will automatically evict NSDiscardableContent objects after the object’s content has been discarded.
- (void)setEvictsObjectsWithDiscardedContent:(BOOL)b
Parameters
b
If YES, the cache evicts NSDiscardableContent objects after the object’s contents has been discarded; if NO the cache does not evict these objects.

Example of [NSCache setEvictsObjectsWithDiscardedContent]
   _cellCache = [[NSCache alloc] init];
   [_cellCache setDelegate:self];
   [_cellCache setEvictsObjectsWithDiscardedContent :NO];