iCloud Key-Value-Store Synchronization issues (NSUbiquitousKeyValueStoreDidChangeExternallyNotification not called)

随声附和 提交于 2019-12-04 06:05:36

I had the same problem. Logging of iCloud on my device, and logging back in, solved the problem :-)

Its probably just simply adding the synchronize to your highscore storer:

func storeNewHighscore(newScore: Int64) {
    NSUbiquitousKeyValueStore.defaultStore().setLongLong(newScore, forKey: KeyValueKeyClassification.KeyHighscore.toRaw())
    NSUserDefaults.standardUserDefaults().setInteger(Int(newScore), forKey: KeyValueKeyClassification.KeyHighscore.toRaw())

    NSUserDefaults.standardUserDefaults().synchronize()

    if NSUbiquitousKeyValueStore.defaultStore().synchronize() {
        println("Synched Successfully")
    }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!