I am seeing the compiler warn that "Instance method -cacheKeyForURL not found" and "Instance method -defaultCachePathForKey not found", in the following code:
SDWebImageManager *manager = [SDWebImageManager sharedManager];
NSString *cacheKey = [manager cacheKeyForURL:[NSURL URLWithString:imageUrl]];
NSString *cachePath = [[manager imageCache] defaultCachePathForKey:cacheKey];
Yet clearly, these methods are defined. Here, for example, is the method definition in SDImageCache.h:
/**
* Get the default cache path for a certain key
*
* @param key the key (can be obtained from url using cacheKeyForURL)
*
* @return the default cache path
*/
- (NSString *)defaultCachePathForKey:(NSString *)key;
At the top of my code file, I am including the relevant files from the SDWebImage project:
#import <SDWebImage/UIImageView+WebCache.h>
#import <SDWebImage/SDImageCache.h>
#import <SDWebImage/SDWebImageManager.h>
Moreover, sharedImageManager
is defined in SDWebImageManager.h
and the compiler is having no problems finding it. I only have warnings on the 2nd and 3rd lines.
My code runs fine and these methods both work without crashing. Why is the compiler telling me it cannot find it?
I am running XCode 6, compiling for Active Architecture Only, iPhone 6 Simulator.
UPDATE
When I compile for Distribution, "All Architectures", suddenly it can find cacheKeyForURL
and defaultCachePathForKey
, no problem, but setImageWithURL
is now deprecated?
I do see the deprecation warnings in UIImageView+WebCache.h, but I'm just super-confused why building for these different architectures is turning on/off various compiler warnings when the header files of SDWebImage don't seem to have anything architecture-specific to them.