Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift CloudKit-CKFetchRecords操作无响应_Swift_Cloudkit - Fatal编程技术网

Swift CloudKit-CKFetchRecords操作无响应

Swift CloudKit-CKFetchRecords操作无响应,swift,cloudkit,Swift,Cloudkit,使用CKFetchRecordsOperation时,我没有收到响应 这是在Xcode版本7.0 beta 4(7A165t)中 我尝试了两种方法将操作添加到队列: let database = CKContainer.defaultContainer().publicCloudDatabase fetchRecords.database = database fetchRecords.start() 及 我在控制台中没有得到任何活动,并且从未接触到处理程序 如果我像这样查询记录,我成功地得到

使用
CKFetchRecordsOperation
时,我没有收到响应

这是在Xcode版本7.0 beta 4(7A165t)中

我尝试了两种方法将操作添加到队列:

let database = CKContainer.defaultContainer().publicCloudDatabase
fetchRecords.database = database
fetchRecords.start()

我在控制台中没有得到任何活动,并且从未接触到处理程序

如果我像这样查询记录,我成功地得到了结果

database.fetchRecordWithID(recordID) { (record:CKRecord?, error:NSError?) -> Void in
            debugPrint("Result"); // The record here exists, and is as expected.

        }

但是,我有一个
CKRecordID
数组,因此我需要
ckfetchrecordsooperation
才能工作。

这似乎是Xcode 7 beta 4中的一个bug


在Xcode 7.0 beta 5版(7A176x)中,它可以正常工作。

您肯定不想在操作中调用
start
。您必须使用
addOperation
来启动操作。当您调用
fetchRecordWithID
时,您得到的是预期的记录还是错误?简单地打印“结果”并不意味着它有效。是的,我得到了正确的记录。记录存在,fetchRecordWithID返回该记录。我还尝试了
addOperation
——结果是一样的(尽管苹果确实建议使用
start
方法:我添加了一份关于Apple Bug Reporter的报告,案例ID为22106406)
let database = CKContainer.defaultContainer().publicCloudDatabase
database.addOperation(fetchRecords)
database.fetchRecordWithID(recordID) { (record:CKRecord?, error:NSError?) -> Void in
            debugPrint("Result"); // The record here exists, and is as expected.

        }