---
title: "initWithRecordsToSave:recordIDsToDelete:atomicByZone:"
framework: cloudkit
role: symbol
role_heading: Instance Method
path: "cloudkit/cksyncenginerecordzonechangebatch/initwithrecordstosave:recordidstodelete:atomicbyzone:"
---

# initWithRecordsToSave:recordIDsToDelete:atomicByZone:

Creates a batch of records to modify.

## Declaration

```occ
- (instancetype) initWithRecordsToSave:(NSArray<CKRecord *> *) recordsToSave recordIDsToDelete:(NSArray<CKRecordID *> *) recordIDsToDelete atomicByZone:(BOOL) atomicByZone;
```

## Parameters

- `recordsToSave`: The records to save.
- `recordIDsToDelete`: The identifiers of the records to delete.
- `atomicByZone`: A Boolean value that determines whether CloudKit modifies the specified records atomically by record zone.

## Return Value

Return Value An initialized change batch.

## Discussion

Discussion important: When using this initializer to create batches, consider the number of records you specify and their combined size. If you specify too many records, or their combined size is too large, the send operation may fail with an error of type CKError.Code.limitExceeded.

## See Also

### Creating a batch

- [initWithPendingChanges:recordProvider:](cloudkit/cksyncenginerecordzonechangebatch/initwithpendingchanges:recordprovider:.md)
- [CKSyncEnginePendingRecordZoneChange](cloudkit/cksyncenginependingrecordzonechange.md)
