SQLite数据库副本
问题描述:
是否有必要将本地Database.sqlite复制到ios环境中的Documents目录?
如果是,那么请解释或引用链接..
Is it is necessary to copy my local Database.sqlite to Documents directory in ios environment? If Yes .,then please explain or refer link..
答
你需要复制它,因为如果你把它放在你的应用程序主包上,它将被只读,这不是你想要的。因此,您必须将.sqlite复制到Documents目录或任何具有写入权限的目录中。
You need to copy it because if you put it on your app main bundle, it will be readOnly, and that's not what you want. So you must copy your .sqlite in Documents directory, or whatever directory where you have write permission.