---
title: "init(persistentStoreCoordinator:configurationName:at:options:)"
framework: coredata
role: symbol
role_heading: Initializer
path: "coredata/nspersistentstore/init(persistentstorecoordinator:configurationname:at:options:)"
---

# init(persistentStoreCoordinator:configurationName:at:options:)

Returns a store initialized with the given arguments.

## Declaration

```swift
init(persistentStoreCoordinator root: NSPersistentStoreCoordinator?, configurationName name: String?, at url: URL, options: [AnyHashable : Any]? = nil)
```

## Parameters

- `root`: A persistent store coordinator.
- `name`: The name of the managed object model configuration to use. Pass nil if you do not want to specify a configuration.
- `url`: The URL of the store to load.
- `options`: A dictionary containing configuration options. See doc://com.apple.coredata/documentation/CoreData/NSPersistentStoreCoordinator for a list of key names for options in this dictionary.

## Return Value

Return Value A new store object, associated with coordinator, that represents a persistent store at url using the options in options and—if it is not nil—the managed object model configuration configurationName.

## Discussion

Discussion You must ensure that you load metadata during initialization and set it using metadata. Special Considerations This is the designated initializer for persistent stores.

## See Also

### Related Documentation

- [metadata](coredata/nspersistentstore/metadata.md)
- [Core Data Programming Guide](apple-archive/documentation/Cocoa/Conceptual/CoreData.md)
- [Atomic Store Programming Topics](apple-archive/documentation/Cocoa/Conceptual/AtomicStore_Concepts/Introduction.md)
- [Incremental Store Programming Guide](apple-archive/documentation/DataManagement/Conceptual/IncrementalStorePG/Introduction.md)
