为什么 NSUserDefaults 备份到 iCloud 但不通过所有设备同步?
Why NSUserDefaults backup to iCloud but not syncing through all devices?
我试图让 NSUserDefaults 通过 iPhone 和 iPad 同步,但事实并非如此!它正在为每台设备备份到 iCloud,但不是从一台设备同步设备到另一个。
知道为什么会这样吗?
根据 UserDefault 文档:
With the exception of managed devices in educational institutions, a
user’s defaults are stored locally on a single device, and persisted
for backup and restore. To synchronize preferences and other data
across a user’s connected devices, use NSUbiquitousKeyValueStore
instead.
我试图让 NSUserDefaults 通过 iPhone 和 iPad 同步,但事实并非如此!它正在为每台设备备份到 iCloud,但不是从一台设备同步设备到另一个。
知道为什么会这样吗?
根据 UserDefault 文档:
With the exception of managed devices in educational institutions, a user’s defaults are stored locally on a single device, and persisted for backup and restore. To synchronize preferences and other data across a user’s connected devices, use NSUbiquitousKeyValueStore instead.