Store Options

Use options dictionary keys to specify store behavior and characteristics.

Topics

Constants

NSReadOnlyPersistentStoreOption

A flag that indicates whether a store is treated as read-only or not.

NSValidateXMLStoreOption

A flag that indicates whether an XML file should be validated with the DTD while opening.

NSPersistentStoreTimeoutOption

Options key that specifies the connection timeout for Core Data stores.

NSSQLitePragmasOption

Options key for a dictionary of SQLite pragma settings with pragma values indexed by pragma names as keys.

NSSQLiteAnalyzeOption

Option key to run an analysis of the store data to optimize indices based on statistical information when the store is added to the coordinator.

NSSQLiteManualVacuumOption

Option key to rebuild the store file, forcing a database wide defragmentation when the store is added to the coordinator.

NSExternalRecordsDirectoryOption

Option indicating the directory where Spotlight external record files should be written to.

Deprecated
NSExternalRecordExtensionOption

Option indicating the file extension to use for Spotlight external record files.

Deprecated
NSExternalRecordsFileFormatOption

Option to specify the file format of a Spotlight external records.

Deprecated
NSPersistentStoreFileProtectionKey

Key to represent the protection class for the persistent store.

NSPersistentStoreUbiquitousContentNameKey

Option to specify that a persistent store has a given name in ubiquity.

Deprecated
NSPersistentStoreUbiquitousContentURLKey

Option to specify the log path to use for ubiquitous content logs.

Deprecated
NSPersistentStoreUbiquitousPeerTokenOption

The corresponding value is an optionally specified string which will be mixed in to Core Data’s identifier for each iCloud peer. The value must be an alphanumeric string without any special characters, whitespace or punctuation. The primary use for this option is to allow multiple applications on the same peer (device) to share a Core Data store integrated with iCloud. Each application will require its own store file.

Deprecated
NSPersistentStoreRemoveUbiquitousMetadataOption

The corresponding value is an NSNumber object representing a boolean that indicates whether the receiver should remove all associated ubiquity metadata from a persistent store. You typically use this option during migration or copying to disassociate a persistent store file from an iCloud account.

Deprecated
NSPersistentStoreUbiquitousContainerIdentifierKey

The corresponding value is a string specifying the iCloud container identifier Core Data should pass to URLForUbiquityContainerIdentifier:.

Deprecated
NSPersistentStoreRebuildFromUbiquitousContentOption

The corresponding value is an NSNumber object representing a boolean that indicates whether the receiver should erase the local store file and rebuild it from the iCloud data in Mobile Documents.

Deprecated

See Also

Configuring Persistent Stores

- addPersistentStoreWithType:configuration:URL:options:error:

Adds a new persistent store of a specified type at a given location, and returns the new store.

- addPersistentStoreWithDescription:completionHandler:

Adds a new persistent store of a specified description, and returns the new store.

- setURL:forPersistentStore:

Sets the URL for a given persistent store.

- removePersistentStore:error:

Removes a given persistent store.

- destroyPersistentStoreAtURL:withType:options:error:

Deletes (or truncates) the target persistent store in accordance with the store class' requirements.

- migratePersistentStore:toURL:options:withType:error:

Moves a persistent store to a new location, changing the storage type if necessary.

persistentStores

The persistent stores associated with the coordinator.

- persistentStoreForURL:

Returns the persistent store for the specified URL.

- URLForPersistentStore:

Returns the URL for a given persistent store.

name

Name of the coordinator.