“无法发送有效的签名”;使用CloudKit时出错 [英] "Couldn't send a valid signature" error when using CloudKit

查看:100
本文介绍了“无法发送有效的签名”;使用CloudKit时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都知道是什么原因导致此错误,该错误在下面的查询块中返回:

Anyone know what could be causing this error which is returned in the query block below:

<CKError 0x7f8d5ba27a10: "Internal Error" (1/4000); "Couldn't send a valid signature">

这是我的代码段:

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

//CKDatabase *publicDatabase = [[CKContainer containerWithIdentifier:container] publicCloudDatabase];

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"doctorName = %@", @"Dr. Harry White"];
CKQuery *query = [[CKQuery alloc] initWithRecordType:@"WellnessTest" predicate:predicate];

[publicDatabase performQuery:query inZoneWithID:nil completionHandler:^(NSArray *results, NSError *error)
{
    if (error)
    {
        // Error handling for failed fetch from public database
        NSLog(@"ERROR: %@", error.description);
    }
    else
    {
        // Display the fetched records
        NSLog(@"Results: %@", results.description);
    }
}];


推荐答案

在iPhone / iPad模拟器上,转到设置> iCloud然后使用您的Apple ID登录。

On the iPhone/iPad simulator go to Settings > iCloud and then log in using your Apple ID.

这篇关于“无法发送有效的签名”;使用CloudKit时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆