In my app user will have a list of items, each item will have a thumbnail,the thumbnails are downloaded from the net, so i want to save the images in the app directory, so that the app won't download thumbnails every time, now i am saving images in NSLibraryDirectory
, and there are many directories available like NSDocumentDirectory,NSApplicationSupportDirectory..
those images will be downloaded if they are not present in the NSLibraryDirectory.My question is which directory is the correct place to save these thumbnail images so the user need not download the images every time. Previously i used NSDocumentLibrary
but i have read that those will be backed up by iCloud and apple could reject the app for that. So, i have changed to NSLibraryDirectory
and everything is working fine. Is it okay to do so. Any better way to store images like that.Thank you
Asked
Active
Viewed 1,885 times
0

BalaChandra
- 632
- 9
- 33
-
Documents directory can be used for storing images. http://stackoverflow.com/a/6907432/366346 . can you post a link where it says its bound to be rejected by apple if used ? – GoodSp33d Apr 24 '14 at 06:31
-
2[File System Programming Guide](https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html) – Desdenova Apr 24 '14 at 06:32
-
You might want to read the File System Programming Guide, https://developer.apple.com/library/mac/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html – Luke Apr 24 '14 at 06:32
-
in file system programming guide it says save the file that cannot be recreated by the app, but the thumbnails can be recreated. But i want them to be saved,so that the user don't have to download each time opening the app.. – BalaChandra Apr 24 '14 at 06:36
-
1This may be helpful: http://stackoverflow.com/a/11641375/771231 – Desdenova Apr 24 '14 at 06:41
-
1@Desdenova that link helped, i have removed the backup option for the file.. Thank you. – BalaChandra Apr 24 '14 at 07:19
2 Answers
1
Here is all about this:
I prefer to store thumbnails in temporary directory which system clears automatically. I also wrote class which is responsible for cache files in directory you set.

Tomasz Szulc
- 4,217
- 4
- 43
- 79
0
it's downloading and retrieve images memory waste. better use: https://github.com/nicklockwood/AsyncImageView

user3559963
- 9
- 2
-
previously i have implemented the same functionality downloading the images asynchronously showing an activity indicator, but the client wants to save the image on phone and don't want a activity indicator.. – BalaChandra Apr 24 '14 at 06:57
-
so better remove activity indicator ... otherwise download first time and save.... next time u can get that image... – user3559963 Apr 24 '14 at 07:46