当前位置 : 主页 > 手机开发 > ios >

ios – CKModifyRecordsOperation完成Swift 2.0

来源:互联网 收集:自由互联 发布时间:2021-06-11
我有下面的代码,但在使用 Xcode 7和 Swift 2.0构建时出现错误 错误是无法调用值非函数类型(([CKRecord]?,[CKRecordID]?,NSError?) – Void)? 谢谢 let saveRecordsOperation = CKModifyRecordsOperation() var ck
我有下面的代码,但在使用 Xcode 7和 Swift 2.0构建时出现错误

错误是无法调用值非函数类型(([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
网友评论