<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreData",
  "identifier" : "/documentation/CoreData/NSIncrementalStore",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:objc(cs)NSIncrementalStore"
  },
  "title" : "NSIncrementalStore"
}
-->

# NSIncrementalStore

An abstract superclass defining the API through which Core Data communicates with a store.

```
class NSIncrementalStore
```

## Overview

You use this interface to create persistent stores that load and save data incrementally, allowing for the management of large and/or shared datasets.

### Subclassing Notes

#### Methods to Override

In a subclass of `NSIncrementalStore`, you *must* override the following methods to provide behavior appropriate for your store:

- [`loadMetadata()`](/documentation/CoreData/NSIncrementalStore/loadMetadata())
- [`execute(_:with:)`](/documentation/CoreData/NSIncrementalStore/execute(_:with:))
- [`newValuesForObject(with:with:)`](/documentation/CoreData/NSIncrementalStore/newValuesForObject(with:with:))
- [`newValue(forRelationship:forObjectWith:with:)`](/documentation/CoreData/NSIncrementalStore/newValue(forRelationship:forObjectWith:with:))
- [`obtainPermanentIDs(for:)`](/documentation/CoreData/NSIncrementalStore/obtainPermanentIDs(for:))

You can also optionally override the following methods:

- [`identifierForNewStore(at:)`](/documentation/CoreData/NSIncrementalStore/identifierForNewStore(at:))
- [`managedObjectContextDidRegisterObjects(with:)`](/documentation/CoreData/NSIncrementalStore/managedObjectContextDidRegisterObjects(with:))
- [`managedObjectContextDidUnregisterObjects(with:)`](/documentation/CoreData/NSIncrementalStore/managedObjectContextDidUnregisterObjects(with:))

There is no need to override the methods that you must otherwise override for a subclass of [`NSPersistentStore`](/documentation/CoreData/NSPersistentStore).

#### Methods that Should Not Be Overridden

In a subclass of `NSIncrementalStore`, you should not override the following methods:

- [`newObjectID(for:referenceObject:)`](/documentation/CoreData/NSIncrementalStore/newObjectID(for:referenceObject:))
- [`referenceObject(for:)`](/documentation/CoreData/NSIncrementalStore/referenceObject(for:))

## Topics

### Manipulating Managed Objects

[`-  executeRequest:withContext:error:`](/documentation/CoreData/NSIncrementalStore/execute(_:with:))

Returns a value as appropriate for the given request, or nil if the request cannot be completed.

[`-  newValuesForObjectWithID:withContext:error:`](/documentation/CoreData/NSIncrementalStore/newValuesForObject(with:with:))

Returns an incremental store node encapsulating the persistent external values of the object with a given object ID.

[`-  newValueForRelationship:forObjectWithID:withContext:error:`](/documentation/CoreData/NSIncrementalStore/newValue(forRelationship:forObjectWith:with:))

Returns the relationship for the given relationship of the object with a given object ID.

[`-  obtainPermanentIDsForObjects:error:`](/documentation/CoreData/NSIncrementalStore/obtainPermanentIDs(for:))

Returns an array containing the object IDs for a given array of newly-inserted objects.

[`-  newObjectIDForEntity:referenceObject:`](/documentation/CoreData/NSIncrementalStore/newObjectID(for:referenceObject:))

Returns a new object ID that uses given data as the key.

[`-  referenceObjectForObjectID:`](/documentation/CoreData/NSIncrementalStore/referenceObject(for:))

Returns the reference data used to construct a given object ID.

### Responding to Context Changes

[`-  managedObjectContextDidRegisterObjectsWithIDs:`](/documentation/CoreData/NSIncrementalStore/managedObjectContextDidRegisterObjects(with:))

Indicates that objects identified by a given array of object IDs are in use in a managed object context.

[`-  managedObjectContextDidUnregisterObjectsWithIDs:`](/documentation/CoreData/NSIncrementalStore/managedObjectContextDidUnregisterObjects(with:))

Indicates that objects identified by a given array of object IDs are no longer being used by a managed object context.

### Accessing Metadata

[`+  identifierForNewStoreAtURL:`](/documentation/CoreData/NSIncrementalStore/identifierForNewStore(at:))

Returns the identifier for the store at a given URL.

[`-  loadMetadata:`](/documentation/CoreData/NSIncrementalStore/loadMetadata())

Loads the metadata for the store.

## Relationships

### Conforms To

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Hashable`](/documentation/Swift/Hashable)

### Inherits From

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

---

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)