Realm Swift: Is it possible to keep database after the apps is uninstalled?

前提是你 提交于 2019-12-01 15:57:53

问题


Using realm swift, is it possible to keep and maintain the realm database file of the apps in device memory even after the apps is uninstalled from the device?

Thank you very much for any help.


回答1:


Applications all files are leftover when deleting an app. iOS apps are Sandboxed. This means that each App has its own space in disk, with its own directories, which act as the home for the app and its data.

Deleting an app from the iPhone deletes this sandbox, deleting all data associated with the app.




回答2:


Sadly not. This is a limitation of iOS more than a limitation of Realm. When an iOS app is uninstalled from a device, all of the files associated with it are deleted (including any Realm files).

If you want file data to persist even after the app is deleted, you'll need to look at a cloud hosting solution to hang onto a copy of those files. In this case, the easiest one would most likely be CloudKit.



来源:https://stackoverflow.com/questions/38342220/realm-swift-is-it-possible-to-keep-database-after-the-apps-is-uninstalled

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!