我正在努力将 iCloud 支持添加到我的收入跟踪应用程序 myIncome,该应用程序目前作为 1.0 版本在 Mac App Store 中,并且在 1.0 版本中可以正常工作。
我只添加了获取 ubiquity 容器并将所选文件上传到 iCloud 的代码。目前我正在使用一个块来查看 iCloud 是否可用于验证发送文件的菜单项。
if ([[NSFileManager defaultManager] URLForUbiquityContainerIdentifier: container] == nil) return NO;
return YES;
我已将密钥添加到权利文件中,并为应用程序提供了一个开发配置文件,其中 iCloud 处于活动状态。
如果代码签名打开,我会在 Console.app 中收到这些消息,并且调试器会runtime_init
停止EXC_BAD_INSTRUCTION
11/4/11 6:52:49.952 PM taskgated: none of the 2 applicable provisioning profile(s) apply
11/4/11 6:52:49.952 PM taskgated: killed com.themikeswan.myIncome[pid 13532] because its use of the com.apple.developer.ubiquity-container-identifiers entitlement is not allowed
如果我关闭代码签名(并清理项目),当我尝试获取 ubiquity 容器并且 Console.app 显示以下消息时,我会返回 nil:
11/4/11 10:38:03.549 PM librariand: client process 13863 does not have a valid com.apple.developer.ubiquity-container-identifiers entitlement
11/4/11 10:38:03.550 PM librariand: error in handle_container_path_request: LibrarianErrorDomain/9/The client process does not have a valid com.apple.developer.ubiquity-container-identifiers entitlement
我制作了一个小型测试应用程序,它是一个 Core Data 应用程序,并且具有启用 iCloud 的应用程序 ID,并且使用相同的代码一切正常,因此 myIncome 中显然存在冲突我只是不确定在哪里寻找问题。
有没有其他人遇到过类似的问题或有任何想法去哪里看?
一旦我让 iCloud 在 myIncome 中工作,我计划编写一个教程,让每个人都能从这些知识中受益,因为现在几乎没有关于如何将 iCloud 添加到 Mac 应用程序的信息。