我正在尝试使用CloudKit从公共数据库中读取数据.
let publicDB = CKContainer.defaultContainer().publicCloudDatabase let query = ... publicDB.performQuery(query,inZoneWithID: nil) { results,error in // "Internal Error" (1/1000); "Received a didCompleteWithError without receiving a response from the server">) }
但是,一旦我登录iCloud,我就会按预期恢复数据.
根据文档,一个人应该能够在不登录的情况下访问公共数据库相关记录,对吗?
需要注意的一点是,我正在使用模拟器.
解决方法
看起来我错过了这部分文档:
In development,when you run your app through Xcode on iOS Simulator
or an iOS device,you also need to enter iCloud credentials to read
records in the public database.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。