阅读背景:

CloudKit:无法续订我们的安全会话

来源:互联网 

I'm trying to request a record from cloudkit with the following code:

我正在尝试使用以下代码从cloudkit请求记录:

 CKContainer *myContainer = [CKContainer defaultContainer];
    CKDatabase *publicDatabase = [myContainer publicCloudDatabase];

    CKDatabase *privateDatabase = [myContainer privateCloudDatabase];

    [publicDatabase saveRecord:artworkRecord completionHandler:^(CKRecord *artworkRecord, NSError *error){
        if (!error) {

            NSLog(@"saved!!!");

            CKDatabase *publicDatabase = [[CKContainer containerWithIdentifier:@"Artwork"] publicCloudDatabase];
            CKRecordID *artworkRecordID = [[CKRecordID alloc] initWithRecordName:@"115"];

            [publicDatabase fetchRecordWithID:artworkRecordID completionHandler:^(CKRecord *artworkRecord, NSError *error) {
                if (error) {

                    NSLog(@"error fetching %@", error);
                }
                else
                {
                    NSLog(@"loading record %@", artworkRecord );
                }
            }];



when I make the request I get this error: "errors === <CKError 0x1780533b0: "Internal Error" (1/4000); "Couldn't renew our secure session">"

But the weird thing is I can save more records with no issues.

但奇怪的是我可以保存更多的记录而没有任何问题。

I'm using a iPad wifi to test this code

我正在使用iPad wifi来测试这段代码

I'll really appreciate your help.

我真的很感谢你的帮助。

1 个解决方案

#1


0  

This error is incorrectly returned if CloudKit couldn't reach the server to get its configuration. This most commonly happens if you're trying to access a container that hasn't been provisioned by the server or if there's an issue with your network connection.

如果CloudKit无法访问服务器以获取其配置,则会错误地返回此错误。如果您尝试访问尚未由服务器配置的容器或者网络连接存在问题,则最常发生这种情况。

This was a bug in CloudKit and more recent iOS and OS X releases should provide a better error message in this case.

这是CloudKit中的一个错误,在这种情况下,更新的iOS和OS X版本应该提供更好的错误消息。


分享到: