1

我可以为我的应用程序保存数据,以防它从应用商店更新。例如,我在 1.0 版中有 sqlite 数据库,然后我已将我的应用程序更新到 1.1 版,如何将此数据库保存在我的文档目录中而不会被覆盖。

4

2 回答 2

3

Your documents will stay where they are - unless the user deletes the app before updating.

Files Saved During App Updates

Files Saved During App Updates When a user downloads an app update, iTunes installs the update in a new app directory. It then moves the user’s data files from the old installation over to the new app directory before deleting the old installation. Files in the following directories are guaranteed to be preserved during the update process:

  • <Application_Home>/Documents
  • <Application_Home>/Library

Although files in other user directories may also be moved over, you should not rely on them being present after an update.

Here is what apple says more about it - Ref link

于 2013-09-15T14:05:14.547 回答
1

当您从应用商店更新您的应用时,您的应用目录的内容不会被覆盖。因此,您不必担心用户更新应用程序时会丢失数据。

只有先删除应用程序,才会删除目录。

于 2013-09-15T13:56:39.687 回答