问题
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