How can I save NSDocument at the same time?

I have a document based application. It can take a few seconds for the document to be saved, so I want the user to continue using the program while saving the document in the background.

Due to the architecture of the document, my application is prompted to save to a temporary location and then the temporary file is copied over the old file. However, this means that I cannot just run my file, saving the code in the background, and go back before doing this, since the temporary file must be written in full before it can be copied.

Is there a way to disable this temp file behavior, or otherwise enable background file saving?

+2


a source to share


2 answers


+2


a source


I don't think there is a good solution for this. If you let the user continue, what happens if they are saved again before the first save operation completes?



I think it's probably best to put a save progress sheet that locks the document until the save is complete.

0


a source







All Articles