Contents

createDestinationInstances(forSource:in:manager:)

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

Declaration

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 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:) method.

Special Considerations

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

See Also

Customizing Stages of the Mapping Life Cycle