Ios iCloud键值从不同步

Ios iCloud键值从不同步,ios,objective-c,xcode,icloud,nsubiquitouskeyvaluestore,Ios,Objective C,Xcode,Icloud,Nsubiquitouskeyvaluestore,我有一个巨大的问题已经三天了。 我正在尝试在iOS上使用iCloud键值存储,但如果没有可见错误,值永远不会与iCloud同步。 当我说它不同步时,它实际上根本就不同步。我可以让应用程序运行15分钟,关闭它,然后再次启动,值仍然不存在 我已经在苹果会员中心的应用程序ID上启用了iCloud。 我已经在我的项目中启用了iCloud的xCode功能。 一切运行正常,没有错误,但当我试图得到我的价值,它根本不存在 以下是我用来与iCloud通信的代码(请记住,我需要与Unity3D一起使用): 所以每

我有一个巨大的问题已经三天了。 我正在尝试在iOS上使用iCloud键值存储,但如果没有可见错误,值永远不会与iCloud同步。 当我说它不同步时,它实际上根本就不同步。我可以让应用程序运行15分钟,关闭它,然后再次启动,值仍然不存在

我已经在苹果会员中心的应用程序ID上启用了iCloud。 我已经在我的项目中启用了iCloud的xCode功能。 一切运行正常,没有错误,但当我试图得到我的价值,它根本不存在

以下是我用来与iCloud通信的代码(请记住,我需要与Unity3D一起使用):

所以每次我启动我的应用程序时,我都会检查一个名为“myKey”的键,该键具有“test”值

如果它不存在,我创建它,如果它存在,我显示它

如果没有悬念,hasKey函数总是返回NO

我尝试在我的应用程序的不同位置调用它,或者多次同步它,但当我重新启动应用程序时,我从来没有得到过我的价值

我查看了iPhone5(运行iOS8.1)的日志,没有关于iCloud的日志。 我在另一个主题上读到,有一个隐藏的iCloud日志,您可以通过与iCloud同步来访问,然后导航到~/Library/Logs/CrashReporter/MobileDevice/iPhone de********/DiagnosticLogs

在这些日志中,我有时会发现:

Nov  4 16:57:29 iPhone-de-******* librariand[139] <Debug>: cancelled, closing fd 4
Nov  4 16:57:29 iPhone-de-******* librariand[139] <Debug>: client process 140 does not have a valid com.apple.developer.ubiquity-container-identifiers entitlement
Nov  4 16:57:29 iPhone-de-******* librariand[139] <Debug>: not tracking pid 140 since it does not require us to enable push
Nov  4 16:57:29 iPhone-de-******* librariand[139] <Debug>: application identifier for process 140 = bird
Nov  4 16:57:29 iPhone-de-******* librariand[139] <Debug>: received request 12 from client 140 (bird): <dictionary: 0x175749a0> { count = 1, contents =
                "Request Type" => <uint64: 0x17683ed0>: 12
        }
Nov  4 16:57:29 iPhone-de-******* librariand[139] <Debug>: container com.apple.shoebox has 0 bytes evictable
Nov  4 16:57:29 iPhone-de-******* librariand[139] <Debug>: client connection error: Connection invalid
Nov 4 16:57:29 iPhone de-*********图书管理员[139]:取消,关闭fd 4
11月4日16:57:29 iPhone de-*********图书管理员[139]:客户端进程140没有有效的com.apple.developer.ubiquity-container-identifiers权限
11月4日16:57:29 iPhone de-*********图书管理员[139]:不跟踪pid 140,因为它不需要我们启用推送
11月4日16:57:29 iPhone de-*********图书管理员[139]:进程140的应用程序标识符=bird
11月4日16:57:29 iPhone de-*******图书管理员[139]:收到来自客户端140(bird)的请求12:{count=1,目录=
“请求类型”=>:12
}
11月4日16:57:29 iPhone de-*********图书管理员[139]:container com.apple.shoebox有0个字节可收回
11月4日16:57:29 iPhone de-*********图书管理员[139]:客户端连接错误:连接无效
问题是我在iCloud授权中找不到任何com.apple.developer.ubiquity-container-identifiers。 所以我创建了它并给它我们的AppID值,但它也不工作(+它在xCode中显示一个错误,因为它无法识别它)

我尝试从手机中删除所有配置文件,但没有任何改变。 我尝试在iCloud中禁用手机数据,但它没有改变任何东西(我也尝试再次启用它,猜猜看,什么都没有改变)

我现在真的被卡住了,谷歌搜索了几乎所有我能找到的与这个错误有关的东西

谢谢你的帮助

Nov  4 16:57:29 iPhone-de-******* librariand[139] <Debug>: cancelled, closing fd 4
Nov  4 16:57:29 iPhone-de-******* librariand[139] <Debug>: client process 140 does not have a valid com.apple.developer.ubiquity-container-identifiers entitlement
Nov  4 16:57:29 iPhone-de-******* librariand[139] <Debug>: not tracking pid 140 since it does not require us to enable push
Nov  4 16:57:29 iPhone-de-******* librariand[139] <Debug>: application identifier for process 140 = bird
Nov  4 16:57:29 iPhone-de-******* librariand[139] <Debug>: received request 12 from client 140 (bird): <dictionary: 0x175749a0> { count = 1, contents =
                "Request Type" => <uint64: 0x17683ed0>: 12
        }
Nov  4 16:57:29 iPhone-de-******* librariand[139] <Debug>: container com.apple.shoebox has 0 bytes evictable
Nov  4 16:57:29 iPhone-de-******* librariand[139] <Debug>: client connection error: Connection invalid