Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In Step 7, you wrote code to autosave the Chef’s Diary and to retrieve its previously autosaved contents after a crash or power failure. In Step 8, you wrote code to back up the document automatically so that the user can retrieve its previous contents even after changes have been saved. One similar operation remains to be coded: the Revert to Saved menu item in the application’s File menu. This menu item allows the user to retrieve the last saved Chef’s Diary contents, discarding changes made since the last save.
Currently, the application’s Revert to Saved menu item doesn’t work correctly. It is connected by default to its built-in NSDocument action method, -revertDocumentToSaved:, but if you choose File > Revert to Saved after saving the diary document and typing some new text, the application crashes. To compound the problem, the menu item is enabled under the wrong conditions. You have to write some code to get this right.