A simple in-memory and in-disk cache for objective-c, You can customize for any object lifecycle
platform :ios, '6.0'
pod 'TTNCache'
#import "TTNCache.h"
TTNCache *cache = [[TTNCache alloc] initWithCacheDirectory:@"TTNCacheDirectory"];
support all <NSCoding> object
- (void)setObject:(id<NSCoding>)obj forKeyedSubscript:(NSString *) key;
- (void)setObject:(id<NSCoding>)obj forKeyedSubscript:(NSString *) key block:(TTNCacheObjectBlock)block;
- (void)setObject:(id<NSCoding>)obj forKeyedSubscript:(NSString *) key andAgeLimit:(NSTimeInterval)ageLimit;
- (void)setObject:(id<NSCoding>)obj forKeyedSubscript:(NSString *) key andAgeLimit:(NSTimeInterval)ageLimit block:(TTNCacheObjectBlock)block;
- (id) objectForKeyedSubscript:(NSString *) key;
- (void)objectForKeyedSubscript:(NSString *)key block:(TTNCacheObjectBlock)block;
- (void) removeObjectForSubscript:(NSString *) key;
- (void) removeObjectForSubscript:(NSString *) key block:(TTNCacheBlock)block;
The repository includes a sample application which shows all of the inter-app hooks in action.
TTNCache is released under the MIT license. See LICENSE for details.