You’re previewing Ry’s Cocoa Tutorial

Document-Based Apps

So far, we’ve learned how to create two different types of OS X applications. Utility apps are simple programs like calculators and clocks that have no persistent data. As we saw in the last chapter, once you start saving and loading data, you can create library-style apps like iPhoto. The defining feature of library-style apps is that they hide the underlying file structure from the user.

The third and final category of OS X apps are document-based applications. Like library-style apps, document-based apps work with persistent data, but they give the user direct access to the on-disk representation of each document. TextEdit is a fantastic example of a document-based app; it lets you open .txt files in separate windows, edit their contents, and save them back to disk.

Directly manipulating files with a document-based app

Cocoa provides a dedicated architecture that includes built-in support for common document-handling operations like saving and loading files. In this chapter, we’ll introduce the main classes in this architecture, as well as their relationship with the model-view-controller pattern.

Sorry, this is the end of the preview. To read the rest of this chapter, you’ll need to purchase Ry’s Cocoa Tutorial.

Mailing List

Sign up for my low-volume mailing list to find out when new content is released. Next up is a comprehensive Swift tutorial planned for late January.

You’ll only receive emails when new tutorials are released, and your contact information will never be shared with third parties. Click here to unsubscribe.