I have an array of images that I download from the server. I need to cache them, and then bring them back to the controller from cache . How correct is this done? After NSCache takes only 1 object with a key ? We'll have to generate a key for each photo? I want to understand itself without libraries.
Asked
Active
Viewed 260 times
0
-
2You can do this. You might use the URL for the image as the key in to the cache. You could store the image data in `NSPurgeableData` instances which along with NSCache will get you some automatic management behavior. But note that this won't push image data to disk, so you need to say more about your needs (how many images? how big? how long are they valid for?) in order to get a more detailed discussion. – Ben Zotto Oct 16 '15 at 16:54
-
Thanks for the answer! I load the tweets from Twitter and photos profiles. And I need to cache the profile photos . – Zept Oct 16 '15 at 16:58