<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreData",
  "identifier" : "/documentation/CoreData/NSBatchInsertRequest",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:objc(cs)NSBatchInsertRequest"
  },
  "title" : "NSBatchInsertRequest"
}
-->

# NSBatchInsertRequest

A request to insert a batch of data in a persistent store.

```
class NSBatchInsertRequest
```

## Topics

### Creating a Request

[`init(entity:dictionaryHandler:)`](/documentation/CoreData/NSBatchInsertRequest/init(entity:dictionaryHandler:))

Creates a batch-insertion request for a managed entity, and specifies a closure that provides data dictionaries for insertion.

[`init(entity:managedObjectHandler:)`](/documentation/CoreData/NSBatchInsertRequest/init(entity:managedObjectHandler:))

Creates a batch-insertion request for a managed entity, and specifies a closure that inserts data into the entity.

[`init(entityName:dictionaryHandler:)`](/documentation/CoreData/NSBatchInsertRequest/init(entityName:dictionaryHandler:)-5l4ps)

Creates a batch-insertion request for a named managed entity, and specifies a closure that provides data dictionaries for insertion.

[`init(entityName:managedObjectHandler:)`](/documentation/CoreData/NSBatchInsertRequest/init(entityName:managedObjectHandler:)-7dr6p)

Creates a batch-insertion request for a named managed entity, and specifies a closure that inserts data into the entity.

[`init(entity:objects:)`](/documentation/CoreData/NSBatchInsertRequest/init(entity:objects:))

Creates a batch-insertion request for a managed entity, and provides an array of data dictionaries for insertion.

[`init(entityName:objects:)`](/documentation/CoreData/NSBatchInsertRequest/init(entityName:objects:))

Creates a batch-insertion request for a named managed entity, and provides an array of data dictionaries for insertion.

[`batchInsertRequestWithEntityName:objects:`](/documentation/CoreData/NSBatchInsertRequest/batchInsertRequestWithEntityName:objects:)

Creates a batch-insertion request for a named managed entity, and provides an array of data dictionaries for insertion.

[`init()`](/documentation/CoreData/NSBatchInsertRequest/init())

Creates a Core Data batch-insertion request.

### Configuring a Request

[`dictionaryHandler`](/documentation/CoreData/NSBatchInsertRequest/dictionaryHandler)

A closure that provides a dictionary for your app to insert data into.

[`entity`](/documentation/CoreData/NSBatchInsertRequest/entity)

The managed entity to insert data into.

[`entityName`](/documentation/CoreData/NSBatchInsertRequest/entityName)

The name of the managed entity to insert data into.

[`managedObjectHandler`](/documentation/CoreData/NSBatchInsertRequest/managedObjectHandler)

A closure that provides a managed object for your app to insert data into.

[`objectsToInsert`](/documentation/CoreData/NSBatchInsertRequest/objectsToInsert)

An array of dictionaries that represents the objects to insert with the keys as attribute names and their assigned values.

[`resultType`](/documentation/CoreData/NSBatchInsertRequest/resultType)

The type of result that Core Data returns from this request.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)