ibireme / YYCache

High performance cache framework for iOS.
MIT License
2.37k stars 505 forks source link

YYCache如何缓存一个模型 #36

Closed jianjianhao closed 8 years ago

jianjianhao commented 8 years ago

比如我写了个Model,我想用YYCache来缓存,但是提示警告 [TestModel encodeWithCoder:]: unrecognized selector sent to instance 0x15e4ac6c0 2016-03-21 16:47:43.069 WisdomCommunity[2247:640281] *\ -[NSKeyedArchiver dealloc]: warning: NSKeyedArchiver deallocated without having had -finishEncoding called on it. 求指导方法

ibireme commented 8 years ago
- (void)setObject:(nullable id<NSCoding>)object forKey:(NSString *)key;

Object 需要实现 NSCoding 协议。

jianjianhao commented 8 years ago

谢谢大神回复