Is it safe to rely on NSUbiquitousKeyValueStore for storing essential data?

天大地大妈咪最大 提交于 2019-12-21 04:25:20

问题


I learned that NSUbiquitousKeyValueStore is always available, also when no iCloud account is set up. This makes me believe I can safely store essential data in it, without keeping a copy in NSUserDefaults.

However, in their documentation, Apple says the following:

Avoid using this class for data that is essential to your app’s behavior when offline; instead, store such data directly into the local user defaults database.

Do I overlook issues that might arise when not using NSUserDefaults (or another offline store) as back-up? Or is Apple being overprotective and is it safe to rely on NSUbiquitousKeyValueStore?


回答1:


Julien commented the following about this question:

What this means is that you should not rely on this store to be your local truth but more of a simple sync communication channel between your devices.



来源:https://stackoverflow.com/questions/23662856/is-it-safe-to-rely-on-nsubiquitouskeyvaluestore-for-storing-essential-data

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