Open driventokill opened 11 years ago
i think NSKeyedUnarchiver cannot read content data of image file.
(UIImage)imageForKey:(NSString)key { UIImage* image = nil;
@try { image=[[[UIImage alloc]initWithContentsOfFile:cachePathForKey(_directory, key)]autorelease]; //image = [NSKeyedUnarchiver unarchiveObjectWithFile:cachePathForKey(_directory, key)]; } @catch (NSException* e) { // Surpress any unarchiving exceptions and continue with nil }
return image; }
You are correct - it may be better to change EGOImageLoader.m to archive the image via setImage:
(void)imageLoadConnectionDidFinishLoading:(EGOImageLoadConnection *)connection { ... } else { // [[EGOCache currentCache] setData:connection.responseData forKey:keyForURL(connection.imageURL,nil) withTimeoutInterval:604800];
[[EGOCache currentCache] setImage:anImage forKey:keyForURL(connection.imageURL,nil) withTimeoutInterval:604800];
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 usingEGOImageLoading
.