---
title: "init(inserted:updated:deleted:locked:)"
framework: coredata
role: symbol
role_heading: Initializer
path: "coredata/nssavechangesrequest/init(inserted:updated:deleted:locked:)"
---

# init(inserted:updated:deleted:locked:)

Initializes a save changes request with collections of given changes.

## Declaration

```swift
init(inserted insertedObjects: Set<NSManagedObject>?, updated updatedObjects: Set<NSManagedObject>?, deleted deletedObjects: Set<NSManagedObject>?, locked lockedObjects: Set<NSManagedObject>?)
```

## Parameters

- `insertedObjects`: Objects that were inserted into the calling context.
- `updatedObjects`: Objects that were updated in the calling context.
- `deletedObjects`: Objects that were deleted in the calling context.
- `lockedObjects`: Objects that were flagged for optimistic locking on the calling context.

## Return Value

Return Value A save changes request initialized with the given changes.
