I'm developing an document-based application that allow users to insert images, movies to make compositions.
When saving the document, I create a directoryFileWrapper in which I put the xml representation of my project, and one fileWrapper for each images/movies using the original path (if document is not saved yet) or the it's relative path inside the package.
Once it's saved, users can move the document to another location/mac and still have access to their content.
If user do a "SaveAsOperation", and save it at the same location, the document is first deleted, and then I have to recreate it. The problem is that I can't recreate the fileWrappers using the relative path, as the document itself is already deleted.
Is there a way to prevent it to happen? What's the right way to save existing files into packages?
-[NSDocument writeToURL:ofType:forSaveOperation:originalContentsURL:error:]? - Willeke