草庐IT

ios - 未调用 iCloud 键值存储更改 (NSUbiquitousKeyValueStoreDidChangeExternallyNotification)

coder 2023-09-07 原文

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 Key-Value-Store Synchronization issues (NSUbiquitousKeyValueStoreDidChangeExternallyNotification not called)

在 iCloud 功能中选择键值存储

CloudKit 共享数据正常

数据已保存到云端,但不会调用更改通知

最佳答案

通过退出 iCloud 帐户并重新登录,一切都开始正常工作

关于ios - 未调用 iCloud 键值存储更改 (NSUbiquitousKeyValueStoreDidChangeExternallyNotification),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31340272/

有关ios - 未调用 iCloud 键值存储更改 (NSUbiquitousKeyValueStoreDidChangeExternallyNotification)的更多相关文章

随机推荐