Я использую CKFetchRecordChangesOperation с CKFetchRecordsChangeToken для захвата изменений, и он говорит мне, что "AppDefaultZone не поддерживает семантику синхронизации".
Вот оскорбительный код:
- (void)downloadServerChangesWithCompletionBlock:(void (^)(NSError *error))completionBlock
{
// Prepare to fetch remote changes
CKDatabase *database = [CKContainer defaultContainer].privateCloudDatabase;
CKRecordZoneID *zoneID = [[CKRecordZoneID alloc] initWithZoneName:CKRecordZoneDefaultName ownerName:CKOwnerDefaultName];
// Initialize fetch record changes operation
CKFetchRecordChangesOperation *fetchRecordChangesOperation = [[CKFetchRecordChangesOperation alloc] initWithRecordZoneID:zoneID previousServerChangeToken:[self changeToken]];
fetchRecordChangesOperation.recordChangedBlock = ^(CKRecord *record) {
[self performRecordChange:record];
};
fetchRecordChangesOperation.recordWithIDWasDeletedBlock = ^(CKRecordID *recordID){
[self performRecordDeletion:recordID];
};
fetchRecordChangesOperation.fetchRecordChangesCompletionBlock = ^(CKServerChangeToken *serverChangeToken, NSData *clientChangeTokenData, NSError *error) {
if (error) {
completionBlock(error);
} else {
[self setChangeToken:serverChangeToken];
completionBlock(nil);
}
};
// Perform the operation
[database addOperation:fetchRecordChangesOperation];
}
И вот ошибка, которую она распечатывает
[PBCloudKitSyncManager] Error Downloading Data:
<CKError 0x157a2500: "Server Rejected Request" (15/2027);
server message = "AppDefaultZone does not support sync semantics";
uuid = [redacted];
container ID = "[redacted]">