Simple in memory and on disk cache. It's backed by an NSCache in memory, so it automatically purges itself when memory gets low. Purged memory keys will automatically be loaded from disk the next time the are requested.
The API is simple.
- (id)objectForKey:(NSString *)key;
- (void)objectForKey:(NSString *)key usingBlock:(void (^)(id object))block;
- (void)setObject:(id)object forKey:(NSString *)key;
See SSCache.h for the full list of methods.
Simply add SSCache.h
and SSCache.m
to your project or if you're using CocoaPods, simply add 'SSCache' to your Podfile.