Tuesday, May 7, 2013

NSCache setTotalCostLimit example ios


setTotalCostLimit:

Sets the maximum total cost that the cache can have before it starts evicting objects.
- (void)setTotalCostLimit:(NSUInteger)lim
Parameters of [NSCache setTotalCostLimit]
lim
The maximum total cost that the cache can have before it starts evicting objects.
Example of [NSCache setTotalCostLimit]
cache = [[NSCache alloc] init];
[cache setCountLimit:100];
[cache setTotalCostLimit:1500000];
[cache setEvictsObjectsWithDiscardedContent:YES];