When was the NSPsistentDocument data store moved to the save destination?

Following the recommendations in the Master Data Programming Guide Basic Performance Indicators page regarding BLOB storage, I decided to save the binary data for mine (only for Leopard, if that makes a difference) in an external file (separate from the Basic data storage document) and maintaining an archive link to this file is in my data warehouse. NSPersistenDocument-based NDAlias

Ultimately, I would like the external data file to end up in the same directory as the document (data store) file. Since I may need to write data to an external data file before the document is saved (this application for collecting scientific data and data loss due to a failure should be avoided if possible), I took the following approach:

I would like to encapsulate the management of this external file in the classes associated with the model, since I will need the same functionality during the migration of the schema. Therefore, managing an external data file in my Subclass seems wrong. NSPersistentDocument's

In the model object, I create an external file in the root object and save by referencing the data file. NSTemporaryDirectory() awakeFromInsert NDAlias

Then I would like to move the external data file to the same directory as the saved data store when the failure occurs.

I thought that would be a suitable place for this, but it looks like a method call to persistent storage is still in the temporary directory (presumably up to create an atom save operation). didSave didSave FSExchangeObjects'd

I plan to include the logic in and in the class methods so that they can be called during the migration of the schema in the user entity policy, respectively. awakeFromInsert didSavecreateDestinationInstancesForSourceInstance:entityMapping:manager:error: and endInstanceCreationForEntityMapping:manager:error:

So my question is: when during the save I can be sure that my root object is the "final" save URL (for example, when the user decided to save the file to save the document)? NSPersistentDocument objectID.persistentStore.URL

+5

All Articles