<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 - 13.1.0"
  ],
  "documentType" : "symbol",
  "framework" : "CoreData",
  "identifier" : "/documentation/CoreData/NSPersistentStoreCoordinator/metadataForPersistentStore(with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPersistentStoreCoordinator(cm)metadataForPersistentStoreWithURL:error:"
  },
  "title" : "metadataForPersistentStore(with:)"
}
-->

# metadataForPersistentStore(with:)

Returns a dictionary that contains the metadata stored in the persistent store at the specified location.

```
class func metadataForPersistentStore(with url: URL) throws -> [AnyHashable : Any]
```

## Parameters

`url`

An URL object that specifies the location of a persistent store.

## Return Value

A dictionary containing the metadata for the persistent store at `url`. If no store is found, or there is a problem accessing its contents, returns `nil`.
The keys guaranteed to be in this dictionary are `NSStoreTypeKey` and `NSStoreUUIDKey`.

## Discussion

This method allows you to access the metadata in a persistent store without initializing a Core Data stack.

## See Also

[`-  setMetadata:forPersistentStore:`](/documentation/CoreData/NSPersistentStoreCoordinator/setMetadata(_:for:))

Updates the metadata for the specified persistent store.

[`-  metadataForPersistentStore:`](/documentation/CoreData/NSPersistentStoreCoordinator/metadata(for:))

Returns the metadata of the specified persistent store.



---

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)