That's because + af_sharedImageCache
is a private method, not exposed on UIImageView+AFNetworking.h
. You can call it, though, using Obj-C runtime.
if ([[self class] respondsToSelector:@sel(af_sharedImageCache)]) {
NSCache *cache = [[self class] performSelector:@sel(af_sharedImageCache)];
}
However, AFImageCache
is a private class, and you would have to do the same hack to use its methods. If I were you, I'd create my own cache, as it's clear that AFNetworking
doesn't want that you mess with its cache implementation.