---
title: "createRelationships(forDestination:in:manager:)"
framework: coredata
role: symbol
role_heading: Instance Method
path: "coredata/nsentitymigrationpolicy/createrelationships(fordestination:in:manager:)"
---

# createRelationships(forDestination:in:manager:)

Constructs the relationships between the newly-created destination instances.

## Declaration

```swift
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

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

## See Also

### Customizing Stages of the Mapping Life Cycle

- [begin(_:with:)](coredata/nsentitymigrationpolicy/begin(_:with:).md)
- [createDestinationInstances(forSource:in:manager:)](coredata/nsentitymigrationpolicy/createdestinationinstances(forsource:in:manager:).md)
- [endInstanceCreation(forMapping:manager:)](coredata/nsentitymigrationpolicy/endinstancecreation(formapping:manager:).md)
- [endRelationshipCreation(forMapping:manager:)](coredata/nsentitymigrationpolicy/endrelationshipcreation(formapping:manager:).md)
- [performCustomValidation(forMapping:manager:)](coredata/nsentitymigrationpolicy/performcustomvalidation(formapping:manager:).md)
- [end(_:manager:)](coredata/nsentitymigrationpolicy/end(_:manager:).md)
