I have a Cocoa document-based app that (currently at least) functions as a basic text editor. It saves .txt, .rtf, and .rtfd, and loads those plus .doc and .docx. If I open a .doc or .docx file and edit it, then try to close, it reminds me to save, but the save option doesn’t do anything since the application is only a viewer for those types of files. How can I make that function as “Save As” for types that can only be viewed, like .doc and .docx?
Share
Override the
saveDocumentWithDelegate:::in your customisedNSDocumentto the following:By default the
delegateis either anNSWindowon window close orNSDocumentControllerif you quit the application and the controller enumerates the windows for reviewing changes.