Chapter 12. Document-Based Applications

For the user, a computer and the applications that it runs are simply ways to access and work with files. The designers of OS X and iOS understand this, and provide a number of tools for making apps designed around letting the user create, edit, and work with documents.

The idea of a document-based application is simple: the application can create documents, and open previously created documents. The user edits the document and saves it to disk. The document can then be stored, sent to another user, duplicated, or anything else that a file can do.

While both OS X and iOS provide technologies that allow you to make document-based applications, the way in which documents are presented to the user differs.

On OS X, as with other desktop-based OSes, users manage their documents through the Finder, which is the dedicated file management application. The entire filesystem is exposed to the user through the Finder.

On iOS, the filesystem is still there, but the user never sees it. Instead, all documents are presented to the user and managed by the application. All the tasks involved in managing documents—creating new files, renaming files, deleting files, copying files, and so on—must be done by your application.

More than one application may be able to open a document. For example, JPEG images can be opened by both the built-in Preview application and by Photoshop for different purposes. Both OS X and iOS provide ways for applications to specify that ...

Get Learning Cocoa with Objective-C, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.