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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access