IOS, where can I locally save images that can be reloaded?

I am currently writing code that will download images from my web server for offline use, I previously stored them in the Documents folder, however I heard that with iOS5 iCloud developers should not store information in documents that may be re-downloaded again.

I tried searching for documents this morning, but cannot find the location that I should use to store these images, I would also like to create my own subfolder in / cache / folder ie / cache / images

Any pointers would be great, I found NSTemporaryDirectory () , but not sure if this is the right place to use.

thank

+5
source share
2 answers

You can access the cache directory like this (more info here )

NSString *directory = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject];

The contents of the temporary directory returned by NSTemporaryDirectory () can be deleted at any time by the system, rather than the cache directory.

+9
source

The main problem with using the document catalog is that it backs up when users synchronize iTunes, and now also with cloud storage. You should only place user items in the document directory, all the rest that can be easily restored / created should be in the cache directory.

+4
source

All Articles