The New Image Viewer

Two custom classes are used to convert the Image Viewer application created in Chapter 3 into a multidocument application with the features that users expect: MYDocument and MYDocumentManager.

Cocoa includes the NSDocument and NSDocumentController classes that have many features in common with MYDocument and MYDocumentManager. Most multidocument Cocoa applications should use the existing NSDocument and NSDocumentController classes because they save work. In fact, they save so much work that they completely hide their interaction with other classes such as NSWindow and NSApplication. Because one of the purposes of this example is to show how NSWindow and NSApplication are used, this example does more work than is usually ...

Get Cocoa® Programming 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.