---
title: "setMetadata(_:forPersistentStoreAt:)"
framework: coredata
role: symbol
role_heading: Type Method
path: "coredata/nspersistentstore/setmetadata(_:forpersistentstoreat:)"
---

# setMetadata(_:forPersistentStoreAt:)

Sets the metadata for the store at a given URL.

## Declaration

```swift
class func setMetadata(_ metadata: [String : Any]?, forPersistentStoreAt url: URL) throws
```

## Parameters

- `metadata`: The metadata for the store at url.
- `url`: The location of the store.

## Discussion

Discussion Subclasses must override this method to set metadata appropriately.

## See Also

### Managing Store Metadata

- [metadataForPersistentStore(with:)](coredata/nspersistentstore/metadataforpersistentstore(with:).md)
- [loadMetadata()](coredata/nspersistentstore/loadmetadata().md)
- [metadata](coredata/nspersistentstore/metadata.md)
