Instance Method

initWithRecordsToSave:recordIDsToDelete:

Initializes and returns an operation object configured to save and delete the specified records.

Declaration

- (instancetype)initWithRecordsToSave:(NSArray<CKRecord *> *)records recordIDsToDelete:(NSArray<CKRecordID *> *)recordIDs;

Parameters

records

An array of CKRecord objects representing the records to save, if any. You may specify nil for this parameter.

recordIDs

An array of CKRecordID objects representing the records you want to delete, if any. You may specify nil for this parameter.

Return Value

An initialized operation object.

Discussion

The records you intend to save or delete must all reside in the same database, which you can specify when you configure the operation object. Saving a record that is not in the current database creates it in the database. Trying to delete a record that does not exist in the current database returns an error for that record.

See Also

Initializing the Operation Object

- init

Initializes and returns an operation object.