I’m working on an image cache on iOS. Images are downloaded from URL and stored in a NSDictionary as a UIImage (I don’t want or need “on disk” cache).
The question is : should I store images in my dictionary as UIImage or NSData ? Which one is significantly smaller in term of memory ?
NSData is smaller because it stores the compressed version of the image. But decompressing takes time, so as long as memory allows, cache the UIImage and clean the cache if you get a memory warning.