Contents

initWithPendingChanges:recordProvider:

Creates a batch of records to modify using the provided record zone changes.

Declaration

- (instancetype) initWithPendingChanges:(NSArray<CKSyncEnginePendingRecordZoneChange *> *) pendingChanges recordProvider:(CKRecord * (^)(CKRecordID *recordID)) recordProvider;

Parameters

  • pendingChanges:

    The record zone changes to process.

  • recordProvider:

    A block that returns the record for the specified record identifier.

Return Value

The batch of records to modify, or nil if there are no pending changes.

Discussion

This method iterates over pendingChanges and adds the necessary information to the new batch, until there are no more changes or the size of the batch reaches the maximum limit. If the type of change is a record save, the method asks the specified recordProvider block for that record. If the closure returns nil, the method skips that change.

See Also

Creating a batch