在哪里存储核心数据文件? [英] Where to store the Core Data file?
问题描述
iOS模板的默认Core Data将数据存储在 NSDocumentDirectory
中的 .sqlite
文件中。
The default Core Data for iOS template stores data in an .sqlite
file in the NSDocumentDirectory
. The file is therefor visible if the iDevice is connected to iTunes and file sharing is enabled.
我想将目录更改为用户不可见的内容,并且我会选择 NSApplicationSupportDirectory
。这是正确的目录吗?
I would like to change the directory to something that is not visible to the user and I would choose the NSApplicationSupportDirectory
. Is this the correct directory? What do other developers use?
推荐答案
最好的地方(iPhone上)是Library文件夹,如下所述:
The best place (on the iPhone) is the Library folder, as described here:
该目录适用于您不希望用户能够访问的数据库见分享。
That directory is meant for things like databases that you do not want the user to be able to see through sharing.
这篇关于在哪里存储核心数据文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!