依靠NSUbiquitousKeyValueStore存储基本数据是否安全? [英] Is it safe to rely on NSUbiquitousKeyValueStore for storing essential data?
问题描述
我了解到 NSUbiquitousKeyValueStore
始终可用,当没有iCloud帐户<时/ a>已设置。这让我相信我可以安全地存储基本数据,而无需在 NSUserDefaults
中保留副本。
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
.
但是, Apple的文档中说明如下:
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.
我是否忽略了不使用<$ c $时可能出现的问题c> NSUserDefaults (或其他离线商店)作为备份?或者Apple是否过度保护,依赖 NSUbiquitousKeyValueStore
?
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
?
推荐答案
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.
这篇关于依靠NSUbiquitousKeyValueStore存储基本数据是否安全?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!