enormego / EGOCache

Fast Caching for Objective-C (iPhone & Mac Compatible)
MIT License
1.33k stars 290 forks source link

problem while unarchive cached object #29

Open driventokill opened 11 years ago

driventokill commented 11 years ago

line 289 in EGOCache.m method - (UIImage*)imageForKey:(NSString*)key. [NSKeyedUnarchiver unarchiveObjectWithFile:cachePathForKey(_directory, key)] return nil and throw a exception: *** -[NSKeyedUnarchiver initForReadingWithData:]: incomprehensible archive (0xffffffff, 0xffffffd8, 0xffffffff, 0xffffffe0, 0x0, 0x10, 0x4a, 0x46) Does anyone else have this problem? I got this problem while using EGOImageLoading.

wingyiu commented 11 years ago

i think NSKeyedUnarchiver cannot read content data of image file.

if TARGET_OS_IPHONE

alexmcarthur commented 11 years ago

You are correct - it may be better to change EGOImageLoader.m to archive the image via setImage: