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.
cache = [[NSCache alloc] init];
[cache setCountLimit:100];
[cache setTotalCostLimit:1500000];
[cache setEvictsObjectsWithDiscardedContent:YES];