<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreData",
  "identifier" : "/documentation/CoreData/NSManagedObjectModel/setEntities(_:forConfigurationName:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:objc(cs)NSManagedObjectModel(im)setEntities:forConfiguration:"
  },
  "title" : "setEntities(_:forConfigurationName:)"
}
-->

# setEntities(_:forConfigurationName:)

Associates the specified entities with the model using the given configuration name.

```
func setEntities(_ entities: [NSEntityDescription], forConfigurationName configuration: String)
```

## Parameters

`entities`

An array of instances of `NSEntityDescription`.

`configuration`

A name for the configuration.

## Discussion

This method raises an exception if the receiver has been used by an object graph manager.

---

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)