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


class NSIncrementalStore : NSPersistentStore


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:

You can also optionally override the following methods:

There is no need to override the methods that you must otherwise override for a subclass of NSPersistentStore.

Methods that Should Not Be Overridden

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


Manipulating Managed Objects

func execute(NSPersistentStoreRequest, with: NSManagedObjectContext?) -> Any

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

func newValuesForObject(with: NSManagedObjectID, with: NSManagedObjectContext) -> NSIncrementalStoreNode

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

func newValue(forRelationship: NSRelationshipDescription, forObjectWith: NSManagedObjectID, with: NSManagedObjectContext?) -> Any

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

func obtainPermanentIDs(for: [NSManagedObject]) -> [NSManagedObjectID]

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

func referenceObject(for: NSManagedObjectID) -> Any

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

Responding to Context Changes

func managedObjectContextDidRegisterObjects(with: [NSManagedObjectID])

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

func managedObjectContextDidUnregisterObjects(with: [NSManagedObjectID])

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

Accessing Metadata

class func identifierForNewStore(at: URL) -> Any

Returns the identifier for the store at a given URL.

func loadMetadata()

Loads the metadata for the store.


Inherits From

Conforms To

See Also

Creating Persistent Stores

class NSPersistentStore

The abstract base class for all Core Data persistent stores.

class NSPersistentStoreDescription

A description object used to create and load a persistent store.

class NSAtomicStore

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

class NSAtomicStoreCacheNode

A concrete class that you use to represent basic nodes in a Core Data atomic store.

class NSPersistentStoreRequest

Criteria used to retrieve data from or save data to a persistent store.

class NSPersistentStoreResult

The abstract base class for results returned from a persistent store coordinator.

class NSPersistentStoreAsynchronousResult

A concrete class used to represent the results of an asynchronous request.

class NSIncrementalStoreNode

A concrete class used to represent basic nodes in a Core Data incremental store.

class NSSaveChangesRequest

An encapsulation of a collection of changes to be made by an object store in response to a save operation on a managed object context.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software