Instance Method

configurePersistentStoreCoordinatorForURL:ofType:modelConfiguration:storeOptions:error:

Creates or loads the document’s persistent store.

Declaration

- (BOOL)configurePersistentStoreCoordinatorForURL:(NSURL *)storeURL ofType:(NSString *)fileType modelConfiguration:(NSString *)configuration storeOptions:(NSDictionary *)storeOptions error:(NSError * _Nullable *)error;

Parameters

storeURL

The URL for the persistent store.

fileType

The document’s file type.

configuration

The managed object model configuration to use.

storeOptions

The options used to configure the persistent store coordinator.

error

Upon return, if a problem occurs, contains an error object that describes the problem.

Return Value

YES if configuration is successful, otherwise NO.

Discussion

You can override this method if you want customize the creation or loading of the document’s persistent store. For example, you can perform post-migration clean-up—if your application needs to migrate store data to use a new version of the managed object model, you can override this method to make additional modifications to the store after migration.

See Also

Managing the Core Data Stack

managedObjectContext

The document’s managed object context.

managedObjectModel

The document’s managed object model.

persistentStoreOptions

Options used when creating the document’s persistent store.

modelConfiguration

A model configuration name to be passed when configuring the persistent store.

- persistentStoreTypeForFileType:

Returns the Core Data store type for a given document file type.