【发布时间】:2015-09-29 04:09:55
【问题描述】:
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 共享数据正常
数据已保存到云端,但不会调用更改通知
【问题讨论】:
标签: ios swift icloud key-value