<!--
{
  "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/NSPersistentStore/init(persistentStoreCoordinator:configurationName:at:options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPersistentStore(im)initWithPersistentStoreCoordinator:configurationName:URL:options:"
  },
  "title" : "init(persistentStoreCoordinator:configurationName:at:options:)"
}
-->

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

Returns a store initialized with the given arguments.

```
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 [`NSPersistentStoreCoordinator`](/documentation/CoreData/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`](/documentation/CoreData/NSPersistentStore/metadata).

### Special Considerations

This is the designated initializer for persistent stores.

## See Also

[`metadata`](/documentation/CoreData/NSPersistentStore/metadata)

The metadata for the persistent store.

  [Core Data Programming Guide](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CoreData/index.html#//apple_ref/doc/uid/TP40001075)

  [Atomic Store Programming Topics](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/AtomicStore_Concepts/Introduction/Introduction.html#//apple_ref/doc/uid/TP40004521)

  [Incremental Store Programming Guide](https://developer.apple.com/library/archive/documentation/DataManagement/Conceptual/IncrementalStorePG/Introduction/Introduction.html#//apple_ref/doc/uid/TP40010706)



---

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)