gpt4 book ai didi

ios - CKModifyRecordsOperation 完成 Swift 2.0

转载 作者:可可西里 更新时间:2023-11-01 17:05:33 26 4
gpt4 key购买 nike

我有下面的代码,但在使用 Xcode 7 和 Swift 2.0 构建时显示错误

错误是 Cannot call value non-function type (([CKRecord]?, [CKRecordID]?, NSError?) -> Void)?谢谢

                    let saveRecordsOperation = CKModifyRecordsOperation()

var ckRecordsArray = [CKRecord]()
// set values to ckRecordsArray

saveRecordsOperation.recordsToSave = ckRecordsArray
saveRecordsOperation.savePolicy = .IfServerRecordUnchanged



saveRecordsOperation.modifyRecordsCompletionBlock { savedRecords, deletedRecordIDs, error in
// deal with conflicts
// set completionHandler of wrapper operation if it's the case
if saveRecordsOperation.finished == true {

}
}

database.addOperation(saveRecordsOperation)

最佳答案

saveRecordsOperation.modifyRecordsCompletionBlock { savedRecords, deletedRecordIDs, error in

应该是

saveRecordsOperation.modifyRecordsCompletionBlock = { savedRecords, deletedRecordIDs, error in

关于ios - CKModifyRecordsOperation 完成 Swift 2.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32311838/

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