---
title: "init(contentsOf:)"
framework: coredata
role: symbol
role_heading: Initializer
path: "coredata/nsmanagedobjectmodel/init(contentsof:)"
---

# init(contentsOf:)

Initializes the managed object model using the model file at the specified URL.

## Declaration

```swift
convenience init?(contentsOf url: URL)
```

## Parameters

- `url`: An URL object specifying the location of a model file.

## Return Value

Return Value A managed object model initialized using the file at url.

## See Also

### Related Documentation

- [Core Data Programming Guide](apple-archive/documentation/Cocoa/Conceptual/CoreData.md)
- [Core Data Model Versioning and Data Migration Programming Guide](apple-archive/documentation/Cocoa/Conceptual/CoreDataVersioning/Articles/Introduction.html.md)

### Creating a managed object model

- [init()](coredata/nsmanagedobjectmodel/init().md)
- [mergedModel(from:)](coredata/nsmanagedobjectmodel/mergedmodel(from:).md)
- [mergedModel(from:forStoreMetadata:)](coredata/nsmanagedobjectmodel/mergedmodel(from:forstoremetadata:).md)
- [init(byMerging:)](coredata/nsmanagedobjectmodel/init(bymerging:).md)
- [init(byMerging:forStoreMetadata:)](coredata/nsmanagedobjectmodel/init(bymerging:forstoremetadata:).md)
