ibireme / YYCache

High performance cache framework for iOS.
MIT License
2.38k stars 511 forks source link

setObject: forKey: withBlock not work... #41

Closed zhangliuliu closed 8 years ago

zhangliuliu commented 8 years ago

setObject: forKey: withBlock not work... but setObject: forKey: works ,why?

ibireme commented 8 years ago

Can you provide more information about "not work"?

zhangliuliu commented 8 years ago
        就是说用setObject forKey保存object是成功的,但是换成setObject withBlock保存同样的object好像就不行,因为我再次用objectForKey取的时候发现没有数据。
        在2016年03月29日 21:25,Yaoyuan 写道:Can you provide more information about "not work"?

—You are receiving this because you authored the thread.Reply to this email directly or view it on GitHub

ibireme commented 8 years ago
_cache = [YYCache cacheWithName:@"test"];
[_cache setObject:@"aa" forKey:@"a"];
NSLog(@"%@", [_cache objectForKey:@"a"]);
[_cache setObject:@"bb" forKey:@"b" withBlock:^{}];
NSLog(@"%@", [_cache objectForKey:@"b"]);

2016-03-29 22:02:22.247 CacheBenchmark[8901:255621] aa
2016-03-29 22:02:22.248 CacheBenchmark[8901:255621] bb

并没有问题