我们应该如何决定使用documentDirectory还是applicationSupportDirectory? [英] How should we decide whether to use documentDirectory or applicationSupportDirectory?

查看:118
本文介绍了我们应该如何决定使用documentDirectory还是applicationSupportDirectory?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们计划存储以下用户文件

We plan to store the following user files

  • SQLite文件
  • 图像文件
  • 音频文件

我们还为用户提供了一个选项,可以将上述文件上传和下载到第三方云存储中.

We also provide an option for users, to upload and download the above files, to a 3rd party cloud storage.

我想知道我们应该使用

FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)

FileManager.default.urls(for: .applicationSupportDirectory, in: .userDomainMask)

出于上述文件存储目的?

for the above file storage purpose?

推荐答案

从历史上看,我们使用"Documents"文件夹,但如今,"Application Support"目录是此类文件的最佳存放位置.

Historically we used the "Documents" folder, but nowadays the "Application Support" directory is the best place for files like this.

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆