问题描述
我想将下载的杂志保存到我的iOS应用中的一个目录中。似乎 NSCachesDirectory
和 NSDownloadsDirectory
是合适的。我不知道它们之间的区别,哪一个适合下载杂志。任何建议都表示赞赏。
I want to save downloaded magazines to one directory in my iOS app. It seems NSCachesDirectory
and NSDownloadsDirectory
are suitable. I don't know the difference between them and which one is suitable for downloading magazines. Any suggestions are appreciated.
推荐答案
在内存不足的情况下可以删除NSCachesDirectory
NSCachesDirectory can be deleted in cases of low memory
如果您不希望删除文件,则必须将它们存储在Documents目录中,但如果您不希望iTunes,iCloud等支持您的文件,请添加不备份。
If you don't want your files to be deleted you have to store them in the Documents directory, but add "do not backup" if you don't want your files to be backed by iTunes, iCloud etc..
请查看苹果的或
这篇关于iOS中的NSCachesDirectory和NSDownloadsDirectory有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!