I'm using setImageWithURL
to download some images in my app. Is it possible:
- to specify how long this image must be held in cache (eg 1 week)?
- to specify how big the the maximum total size of the cache (eg 200 MB)
- to see what is in the image cache?
- to clear the cache?
The documentation is not really clear on these points..
The
UIImageView
category uses an internal, ephemeral cache for high performance in things likeUITableView
. For longer-term cache, use the system-level cacheing system--namely Peter Steinberger's fork ofSDURLCache
, a subclass ofNSURLCache
.Set it up with the following code in the application delegate
applicationDidFinishLaunching:withOptions:
: