gpt4 book ai didi

ios - 使用键值对将词典发送到 iCloud

转载 作者:行者123 更新时间:2023-11-29 12:36:46 24 4
gpt4 key购买 nike

我正在使用此代码将字典写入 iCloud。

 [[NSUbiquitousKeyValueStore defaultStore]
setDictionary:dictCloudTables forKey:@"Tables"];

[[NSUbiquitousKeyValueStore defaultStore] synchronize];

我正在使用这段代码从云端获取字典:

 dictCloudTables = [[[NSUbiquitousKeyValueStore defaultStore]
dictionaryForKey:@"Tables"] mutableCopy];

它总是给我第一次插入的字典。

我的代码有什么问题吗?

最佳答案

我没有发现代码有任何明显的错误(除非您不检查 synchronise 的返回值)。我认为您对应该发生的事情的期望可能是错误的。以下是文档的摘录:

This method does not force new keys and values to be written to iCloud. Rather, it lets iCloud know that new keys and values are available to be uploaded. Do not rely on your keys and values being available on other devices immediately.

关于ios - 使用键值对将词典发送到 iCloud,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26100806/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com