Exercises

  1. In addition to PDF, the NSView and NSWindow classes can also generate EPS files. Extend the GraphPaper application so that it can also save files as EPS.

  2. Can you improve GraphPaper’s handling of resizing? If so, how?

  3. Try setting the tag of one of the pop-up cells to “0” so that the NSInternalInconsistencyException is raised. What are exceptions and how are they handled?

  4. Write an exception handler to catch the NSInternalInconsistencyException exception.

  5. Why does the [formatBox retain]; method call appear in the saveDocumentTo: method? What happens if it is removed? Why?

Get Building Cocoa Applications: A Step by Step Guide 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.