<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreData",
  "identifier" : "/documentation/CoreData/NSEntityMigrationPolicy/createRelationships(forDestination:in:manager:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:objc(cs)NSEntityMigrationPolicy(im)createRelationshipsForDestinationInstance:entityMapping:manager:error:"
  },
  "title" : "createRelationships(forDestination:in:manager:)"
}
-->

# createRelationships(forDestination:in:manager:)

Constructs the relationships between the newly-created destination instances.

```
func createRelationships(forDestination dInstance: NSManagedObject, in mapping: NSEntityMapping, manager: NSMigrationManager) throws
```

## Parameters

`dInstance`

The destination instance for which to create relationships.

`mapping`

The mapping object in use.

`manager`

The migration manager performing the migration.

## Discussion

You can use this stage to (re)create relationships between migrated objects—you use the association lookup methods on the [`NSMigrationManager`](/documentation/CoreData/NSMigrationManager) instance to determine the appropriate relationship targets.

---

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)