Configures the receiver’s persistent store coordinator with the appropriate stores for a given URL.
- macOS 10.5+
An URL that specifies the location of the document's store.
The document type.
The name of the managed object model configuration to use. (The managed object model is associated with the persistent store coordinator.) Pass
nilif you do not want to specify a configuration.
Options for the store. See “Store Options” in
NSPersistentfor possible values.
If the method does not complete successfully, upon return contains an
NSErrorobject that describes the problem.
YES if the method completes successfully, otherwise
This method is invoked automatically when an existing document is opened. You override this method to customize creation of a persistent store for a given document or store type. You can retrieve the persistent store coordinator with the following code:
You can override this method to create the store to save to or load from (invoked from within the other
NSDocument methods to read/write files), which gives developers the ability to load/save from/to different persistent store types (default type is XML).