<!--
{
  "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/createDestinationInstances(forSource:in:manager:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:objc(cs)NSEntityMigrationPolicy(im)createDestinationInstancesForSourceInstance:entityMapping:manager:error:"
  },
  "title" : "createDestinationInstances(forSource:in:manager:)"
}
-->

# createDestinationInstances(forSource:in:manager:)

Creates the destination instance(s) for a given source instance.

```
func createDestinationInstances(forSource sInstance: NSManagedObject, in mapping: NSEntityMapping, manager: NSMigrationManager) throws
```

## Parameters

`sInstance`

The source instance for which to create destination instances.

`mapping`

The mapping object in use.

`manager`

The migration manager performing the migration.

## Discussion

This method is invoked by the migration manager on each source instance (as specified by the [`sourceExpression`](/documentation/CoreData/NSEntityMapping/sourceExpression) in the mapping) to create the corresponding destination instance(s). It also associates the source and destination instances by calling `NSMigrationManager`’s [`associate(sourceInstance:withDestinationInstance:for:)`](/documentation/CoreData/NSMigrationManager/associate(sourceInstance:withDestinationInstance:for:)) method.

### Special Considerations

If you override this method and do not invoke `super`, you must invoke `NSMigrationManager`’s [`associate(sourceInstance:withDestinationInstance:for:)`](/documentation/CoreData/NSMigrationManager/associate(sourceInstance:withDestinationInstance:for:)) to associate the source and destination instances as required. .

---

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)