TMCache - 并行对象缓存


Apache
OS X
Objective-C

软件简介

TMCache 是 Tumblr 公司开发的一个快速,无死锁的并行对象缓存,支持 iOS 和 OS X 系统。

示例代码:

UIImage *img = [[UIImage alloc] initWithData:data scale:[[UIScreen mainScreen]
scale]];
[[PINCache sharedCache] setObject:img forKey:@”image” block:nil]; // returns
immediately

[[PINCache sharedCache] objectForKey:@”image”
block:^(PINCache cache, NSString key, id object) {
UIImage image = (UIImage )object;
NSLog(@”image scale: %f”, image.scale);
}];