Exercises

  1. When the About MathPaper panel first opens, there is an annoying flash where the pulsating icon is located. What is it? Fix it.

  2. Change the star in the About MathPaper panel to a fancier design that animates well.

  3. Instead of subclassing the NSApplication object, you could have implemented the About panel by creating an Application Delegate class and having the AboutMathPaper menu command send a message directly to an instance of the delegate class. What would be the advantages and the disadvantages to this approach? Try implementing it.

  4. The About panel has a memory leak: the NSImage for the PaperIcon is retained but it is never released. The image should be released in a dealloc method. Implement this method. Will the method ever be invoked? If not, what’s the point of writing it?

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.