NSUbiquitousKeyValueStoreDidChangeExternallyNotification根本没有被调用?
var keyStore: NSUbiquitousKeyValueStore?
viewDidLoad{
NSNotificationCenter.defaultCenter().addObserver(self,
selector: "ubiquitousKeyValueStoreDidChange:",
name: NSUbiquitousKeyValueStoreDidChangeExternallyNotification,
object: keyStore)
userDefinedLabelOne.text = keyStore?.stringForKey("userDefinedStringOne") <---this is changed
}
func ubiquitousKeyValueStoreDidChange(notification: NSNotification) {
println("Changed") <---- Not called
}
在 iCloud 功能中选择键值存储
CloudKit 共享数据正常
数据已保存到云端,但不会调用更改通知
最佳答案
通过退出 iCloud 帐户并重新登录,一切都开始正常工作
关于ios - 未调用 iCloud 键值存储更改 (NSUbiquitousKeyValueStoreDidChangeExternallyNotification),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31340272/