---
title: managedObjectModel
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nspersistentdocument/managedobjectmodel
---

# managedObjectModel

The managed object model of the document.

## Declaration

```swift
var managedObjectModel: NSManagedObjectModel? { get }
```

## Discussion

Discussion By default the Core Data framework creates a merged model from all models in the application bundle ([NSBundle mainBundle]). You can reimplement this property and return a specific model to use to create persistent stores. A typical implementation might include code similar to the following fragment: NSBundle *bundle = [NSBundle bundleForClass:[self class]]; NSString *path = [bundle pathForResource:@"MyModel" ofType:@"mom"]; NSURL *url = [NSURL fileURLWithPath:path]; NSManagedObjectModel *model = [[NSManagedObjectModel alloc] initWithContentsOfURL:url]; Special Considerations In applications built in OS X v10.4, by default the Core Data framework creates a merged model from all the models found in the application bundle and the frameworks against which the application is linked.

## See Also

### Managing the Persistence Objects

- [managedObjectContext](appkit/nspersistentdocument/managedobjectcontext.md)
- [configurePersistentStoreCoordinator(for:ofType:modelConfiguration:storeOptions:)](appkit/nspersistentdocument/configurepersistentstorecoordinator(for:oftype:modelconfiguration:storeoptions:).md)
- [persistentStoreType(forFileType:)](appkit/nspersistentdocument/persistentstoretype(forfiletype:).md)
