我正在使用iOS 10处理Xcode 8.3并且我遵循Apple的Cloud Kit Quick Start文档来维护云数据的本地缓存,并且当私有数据库区域中的数据为时,我的设备能够接收推送通知已更改,但在尝试获取区域更改时,我总是会收到以下错误:
2017-06-17 11:58:11.376807-0400 MyApp[10694:5029263] received remote notification
2017-06-17 11:58:11.897402-0400 MyApp[10694:5031532] fetch database change completed
2017-06-17 11:58:11.897606-0400 MyApp[10694:5031532] zone deletions
2017-06-17 11:58:12.320908-0400 MyApp[10694:5031561] record zone fetch completed
Error fetching zone changes for private database: <CKError 0x170256620: "Invalid Arguments" (12/2006); server message = "Bad sync continuation data"; uuid = xxxxxxxx-EFD7-459D-xxxx-xxxxxxxxxxx; container ID = "iCloud.com.mycompany.MyApp">
2017-06-17 11:58:12.332247-0400 MyApp[10694:5031561] fetch record zone changes completed
Error fetching zone changes for private database: <CKError 0x174640150: "Partial Failure" (2/1011); "Couldn't fetch some items when fetching changes"; uuid = xxxxxxxx-EFD7-459D-xxxx-xxxxxxxxxxx; container ID = "iCloud.com.mycompany.MyApp"; partial errors: {
PrivateZone:__defaultOwner__ = <CKError 0x170254670: "Invalid Arguments" (12/2006); server message = "Bad sync continuation data">
}>
“错误同步延续数据”非常令人困惑,因为我无法在Apple的文档中找到此错误的解释或在Google搜索中找到任何引用。有没有人遇到过这个?
答案 0 :(得分:4)
在这个上下文中深入思考“延续”的含义,并深入研究Apple示例后,我意识到问题是我只保留了一个变量,用于在不同的获取更改阶段返回的服务器更改令牌,如fetchDatabaseChanges
和fetchZoneChanges
方法。添加变量以跟踪数据库更改令牌和区域更改令牌(每个区域都有自己的)后,“错误同步连续数据”错误消失,我可以看到从服务器返回的更改记录。