I recently upgraded a project to SDWebImage 4.0, which I'm only using to cache images and later retrieve them. Had this working flawlessly on the 3.x version. I'm now getting the following error after migrating...
-[SDImageCache storeImage:forKey:toDisk:completion:]: unrecognized selector sent to instance 0x174097cf0
This seems like it should be a simple error to resolve, but after multiple attempts, I'm unable to fix it.
Here is my previous code from the 3.x API...
@property (strong, nonatomic) SDImageCache *imageCache;
- (SDImageCache *)imageCache {
if (!_imageCache) {
_imageCache = [[SDImageCache alloc] initWithNamespace:NAME_SPACE_IMAGE_CACHE];
}
return _imageCache;
}
[self.imageCache storeImage:[UIImage imageWithContentsOfFile:imageData.imageURL.path] forKey:imageData.imageURL.absoluteString toDisk:YES];
Here is my updated code for the 4.0 API, which is the line of code throwing the error...
[self.imageCache storeImage:[UIImage imageWithContentsOfFile:imageData.imageURL.path] forKey:imageData.imageURL.absoluteString toDisk:YES completion:^{
NSLog(@"INFO: Image cached successfully!");
}];
Could someone please help clarify what the issue is?
Thanks in advance!