我试图简单地将记录保存到用户私有数据库但是当我运行 privateDB.saveRecord() 时我收到一条错误消息
Not Authenticated" (9/1002); "CloudKit access was denied by user settings"; Retry after 3.0 seconds>.
此帐户能够登录到 cloudkit 仪表板,因此它是应用程序的开发人员。还有哪些其他问题可能导致这种情况?任何帮助将不胜感激,我已经坚持了这么久。
这是我的代码:
//variable instantiation
container = CKContainer.defaultContainer()
println(container.containerIdentifier)
publicDB = container.publicCloudDatabase
privateDB = container.privateCloudDatabase
//save record code
let passRecord = CKRecord(recordType: "Password")
passRecord.setValue("testytestPow", forKey: "title")
passRecord.setValue("password02", forKey: "value")
privateDB.saveRecord(passRecord, completionHandler: { (record, error) -> Void in
if (error != nil) {
println(error)
} else {
NSLog("Saved in cloudkit")
self.fetchTodos()
}
})