---
title: NSAtomicStore
framework: coredata
role: symbol
role_heading: Class
path: coredata/nsatomicstore
---

# NSAtomicStore

An abstract superclass that you subclass to create a Core Data atomic store.

## Declaration

```swift
class NSAtomicStore
```

## Overview

Overview Use an atomic store to handle data sets that can be expressed in memory. The atomic store API favors simplicity over performance. This class provides default implementations of some utility methods. Create a custom atomic store subclass when you have a custom file format that you want to integrate with a Core Data app. When you create a subclass, override the following NSAtomicStore methods: load() newCacheNode(for:) newReferenceObject(for:) save() updateCacheNode(_:from:) Also override the following properties and methods of NSPersistentStore, from which the atomic store class inherits: type identifier metadata metadataForPersistentStore(with:) setMetadata(_:forPersistentStoreAt:) NSAtomicStore provides a default dictionary of metadata. This dictionary contains the store type and identifier (NSStoreTypeKey and NSStoreUUIDKey) as well as store versioning information. Subclasses must ensure that the metadata is saved along with the store data.

## Topics

### Initializing a Store

- [init(persistentStoreCoordinator:configurationName:at:options:)](coredata/nsatomicstore/init(persistentstorecoordinator:configurationname:at:options:).md)

### Loading a Store

- [load()](coredata/nsatomicstore/load().md)
- [objectID(for:withReferenceObject:)](coredata/nsatomicstore/objectid(for:withreferenceobject:).md)
- [addCacheNodes(_:)](coredata/nsatomicstore/addcachenodes(_:).md)

### Updating Cache Nodes

- [newCacheNode(for:)](coredata/nsatomicstore/newcachenode(for:).md)
- [newReferenceObject(for:)](coredata/nsatomicstore/newreferenceobject(for:).md)
- [updateCacheNode(_:from:)](coredata/nsatomicstore/updatecachenode(_:from:).md)
- [willRemoveCacheNodes(_:)](coredata/nsatomicstore/willremovecachenodes(_:).md)

### Saving a Store

- [save()](coredata/nsatomicstore/save().md)

### Utility Methods

- [cacheNodes()](coredata/nsatomicstore/cachenodes().md)
- [cacheNode(for:)](coredata/nsatomicstore/cachenode(for:).md)
- [referenceObject(for:)](coredata/nsatomicstore/referenceobject(for:).md)

## Relationships

### Inherits From

- [NSPersistentStore](coredata/nspersistentstore.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Store Coordination

- [NSPersistentStoreCoordinator](coredata/nspersistentstorecoordinator.md)
- [NSPersistentStore](coredata/nspersistentstore.md)
- [NSPersistentStoreDescription](coredata/nspersistentstoredescription.md)
- [NSPersistentStoreRequest](coredata/nspersistentstorerequest.md)
- [NSPersistentStoreResult](coredata/nspersistentstoreresult.md)
- [NSPersistentStoreAsynchronousResult](coredata/nspersistentstoreasynchronousresult.md)
- [NSSaveChangesRequest](coredata/nssavechangesrequest.md)
- [NSAtomicStoreCacheNode](coredata/nsatomicstorecachenode.md)
- [NSIncrementalStore](coredata/nsincrementalstore.md)
- [NSIncrementalStoreNode](coredata/nsincrementalstorenode.md)
