<!--
{
  "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/NSMappingModel",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:objc(cs)NSMappingModel"
  },
  "title" : "NSMappingModel"
}
-->

# NSMappingModel

A model instance that specifies how to map a model from a source to a destination managed object model.

```
class NSMappingModel
```

## Topics

### Creating a Mapping

[`+  mappingModelFromBundles:forSourceModel:destinationModel:`](/documentation/CoreData/NSMappingModel/init(from:forSourceModel:destinationModel:))

Returns the mapping model that will translate data from the source to the destination model.

[`+  inferredMappingModelForSourceModel:destinationModel:error:`](/documentation/CoreData/NSMappingModel/inferredMappingModel(forSourceModel:destinationModel:))

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

[`-  initWithContentsOfURL:`](/documentation/CoreData/NSMappingModel/init(contentsOf:))

Returns a mapping model initialized from a given URL.

### Managing Entity Mappings

[`entityMappings`](/documentation/CoreData/NSMappingModel/entityMappings)

The entity mappings for the mapping model.

[`entityMappingsByName`](/documentation/CoreData/NSMappingModel/entityMappingsByName)

The entity mappings for the mapping model, keyed by name.

## Relationships

### Conforms To

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)