ESCache is a simple NSCache/NSMutableDictionary (in secure version) wrapper which is backed by on-disk persistence. It has two useful classes: ESCache and ESSecureCache.
ESCache class might be used when you need to persist NSCache'd data to share it between launch sessions. ESSecureCache might be used to share data between sessions and it also encrypts persistent storage.
It's as simple as NSDictionary: you set and get objects. The only requirement is that these objects should conform to NSCoding protocol.
ESCache *cache = [[ESCache sharedCache] setObject:@"string to share" forKey:@"key"];
NSString *object = [[ESCache sharedCache] objectForKey:@"key"];
It has two possible ways to persist cached data: file-backed persistence and NSUserDefaults. File-backed persistence is used as 'default' in +sharedCache
so use -initWithName:type:error:
initializer to implicitly specify persistence type.
// cache's name is used as a key for NSUserDefaults' -setObject:forKey:
// it would be used as a file name in case of file-backed persistence
_cache = [[ESSecureCache alloc] initWithName:@"ESSecureCache" type:ESSecureCacheTypeUserDefaults error:NULL];
[_cache setObject:@"string object" forKey:@"key"];
NSString *object = [_cache objectForKey:@"key"];
ESCache requires iOS 4.3 and above or OS X 10.7 and above.
ESCache supports both ARC and non-ARC environment.
Drop me a line if you have questions regarding to that library.
ESCache is available under the MIT license. See the LICENSE file for more info.