gpt4 book ai didi

objective-c - 难倒了 [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier :nil] keeps returning nil

转载 作者:搜寻专家 更新时间:2023-10-30 20:06:19 24 4
gpt4 key购买 nike

我编写了一个简单的测试应用程序 (Mac/Cocoa) 来连接到 iCloud 中的键值存储。我似乎在第一道篱笆上摔倒了。

您可以在此处查看我的简单应用程序的代码,您会发现我没有从“URLForUbiquityContainerIdentifier”调用中获取返回的 URL。

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Insert code here to initialize your application
NSURL *ubiq = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil];
if (!ubiq)
NSLog(@"No iCloud");
else
NSLog(@"Yes iCloud");
}

应用程序运行时的屏幕截图:

enter image description here

在尝试查看我是否已正确设置所有内容方面,我在开发人员配置中心查看了我的 App Id(测试应用称为 Radio)的设置:

enter image description here

所以这似乎没问题。然后我重新创建了我的配置文件(称为 Radio Dev 2)并检查它是否使用了正确的 App Id:

enter image description here

好的,所以这似乎也可以。然后我检查权利是否已打开并且键值容器已激活:

enter image description here

所以他们被激活了。然后我查看了文件本身,看看是否有任何内容跳出:

enter image description here

所以我在权利文件中看不到任何内容。最后,我确认我正在使用我预期的配置文件使用正确的证书对构建进行签名:

enter image description here

我对此很满意。

所以我很难过。我已经重新生成了所有内容,但无济于事。

如果有人有任何想法,我将不胜感激。我错过了什么吗?

最佳答案

Damien 对这个问题的评论为我提供了解决方案。对于使用 Xcode 4.5 的任何人,您需要单击 Ubiquity Containers 框下方的 +。在我这样做之前,没有任何效果。

Xcode

关于objective-c - 难倒了 [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier :nil] keeps returning nil,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11938231/

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