17 #import <Foundation/Foundation.h>
19 #import "NIPreprocessorMacros.h"
41 - (id)initWithCapacity:(NSUInteger)capacity;
45 - (void)storeObject:(
id)object withName:(NSString *)name;
46 - (void)storeObject:(
id)object withName:(NSString *)name expiresAfter:(NSDate *)expirationDate;
48 - (void)removeObjectWithName:(NSString *)name;
49 - (void)removeAllObjectsWithPrefix:(NSString *)prefix;
52 - (id)objectWithName:(NSString *)name;
53 - (BOOL)containsObjectWithName:(NSString *)name;
54 - (NSDate *)dateOfLastAccessWithName:(NSString *)name;
63 - (BOOL)shouldSetObject:(
id)object withName:(NSString *)name previousObject:(
id)previousObject;
64 - (void)didSetObject:(
id)object withName:(NSString *)name;
65 - (void)willRemoveObject:(
id)object withName:(NSString *)name;
68 - (BOOL)willSetObject:(
id)object withName:(NSString *)name previousObject:(
id)previousObject __NI_DEPRECATED_METHOD;
void removeAllObjects()
Removes all objects from the cache, regardless of expiration dates.
An in-memory cache for storing objects with expiration support.
void reduceMemoryUsage()
Removes all expired objects from the cache.
An in-memory cache for storing images with caps on the total number of pixels.
unsigned long long numberOfPixels
Returns the total number of pixels being stored in the cache.
NSString * nameOfMostRecentlyUsedObject()
Retrieve the key with the most fresh access.
unsigned long long maxNumberOfPixelsUnderStress
The maximum number of pixels this cache may store after a call to reduceMemoryUsage.
NSUInteger count()
Returns the number of objects currently in the cache.
unsigned long long maxNumberOfPixels
The maximum number of pixels this cache may ever store.
NSString * nameOfLeastRecentlyUsedObject()
Retrieve the name of the object that was least recently used.