Instance Method

initWithPersistentStoreCoordinator:configurationName:URL:options:

Returns a store initialized with the given arguments.

Declaration

- (instancetype)initWithPersistentStoreCoordinator:(NSPersistentStoreCoordinator *)root configurationName:(NSString *)name URL:(NSURL *)url options:(NSDictionary *)options;

Parameters

coordinator

A persistent store coordinator.

configurationName

The name of the managed object model configuration to use. Pass nil if you do not want to specify a configuration.

url

The URL of the store to load.

options

A dictionary containing configuration options. See NSPersistentStoreCoordinator for a list of key names for options in this dictionary.

Return Value

A new store object, associated with coordinator, that represents a persistent store at url using the options in options and—if it is not nil—the managed object model configuration configurationName.

Discussion

You must ensure that you load metadata during initialization and set it using metadata.

Special Considerations

This is the designated initializer for persistent stores.