Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Recipe 3. Create a Simple Text Document > Step 5: Create the VRDocument-Control...

Step 5: Create the VRDocument-Controller Class and a New Menu Item

You haven’t yet arranged for storage of the document’s contents. Before you can attend to that, however, there is one other important feature missing. You have provided no way to create a new Diary Document or to open its window.

You know from Recipe 1 that the Cocoa document-based application template automatically provides a mechanism to create new documents of the application’s primary document type. In Vermont Recipes, the primary document type is the recipes database, controlled by RecipesDocument, RecipesWindowController, and the RecipesWindow nib file, all of which were provided to you by the template under the name MyDocument. The application’s File menu came with a standard New menu item in the MainMenu nib file provided by the template, and you saw in Recipe 1 that you could use it to open new recipes document windows at will. The first new recipes document is automatically opened when you launch the application.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint