嗨,所有CloudKit
用户:
我有一个可怕的时间试图找出为什么CKDatabaseOperation
不给出任何反馈.CKRecords
在蜂窝上保存时没有错误,也没有回调.
能告诉我你对此有何看法?
Apple开发者论坛中的某个人找到了一个解决方案:https: //forums.developer.apple.com/thread/20047
设置时会发生魔力 qualityOfService = .UserInitiated
例:
let publicDB = CKContainer.defaultContainer().publicCloudDatabase let operation = CKModifyRecordsOperation(recordsToSave: [aRecord], recordIDsToDelete: nil) operation.allowsCellularAccess = true operation.qualityOfService = .UserInitiated // <----- THATS THE CELLULAR FIX operation.perRecordProgressBlock = {(record, progress) in print("Progress: \(Int(progress*100.0))%") } operation.perRecordCompletionBlock = {(record, error) in print("Upload complete") //Add awesome error handling here } publicDB.addOperation(operation)