According to Apple's docs, closeAllDocumentsWithDelegate
(from NSDocumentController
) should call canCloseDocumentWithDelegate
of NSDocument
for all open documents if you quit an application.
In my NSPersistentDocument
-based app I need to override canCloseDocumentWithDelegate
in order to warn the user in case a certain server functionality is still running when the document closes. This has nothing to do with any data changes.
This works when the user closes a single document; I can present a sheet with the warning and let the user cancel the closing process.
However, my version of canCloseDocumentWithDelegate
does not get called when the app is quit. What could be the reason for that?