init(persistentStoreCoordinator:configurationName:at:options:)
Returns a store initialized with the given arguments.
Declaration
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
nilif you do not want to specify a configuration. - url:
The URL of the store to load.
- options:
A dictionary containing configuration options. See Nspersistentstorecoordinator for a list of key names for options in this dictionary.
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
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- Core Data Programming Guide
- Atomic Store Programming Topics
- Incremental Store Programming Guide