Contents

inferredMappingModel(forSourceModel:destinationModel:)

Returns a newly created mapping model that will migrate data from the source to the destination model.

Declaration

class func inferredMappingModel(forSourceModel sourceModel: NSManagedObjectModel, destinationModel: NSManagedObjectModel) throws -> NSMappingModel

Parameters

  • sourceModel:

    The source managed object model.

  • destinationModel:

    The destination managed object model.

Mentioned in

Return Value

A newly-created mapping model to migrate data from the source to the destination model. If the mapping model can not be created, returns nil.

Discussion

A model will be created only if all changes are simple enough to be able to reasonably infer a mapping (for example, removing or renaming an attribute, adding an optional attribute or relationship, or adding renaming or deleting an entity). Element IDs are used to track renamed properties and entities.

See Also

Creating a Mapping