O'Reilly logo

Beginning Mac OS® X Programming by Drew McCormack, Michael Trent

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

8.13. Summary

You learned a lot in this chapter, including the following:

  • How to bind your application's user interface to your custom code. Interface Builder's outlets and actions allow you to manage this relationship directly, although it can be tedious in larger programs. Cocoa Bindings provide an easier way of coordinating your data with your user interface, although it may not be appropriate in all cases. Fortunately, you can use both of these techniques within the same program to get the best of both worlds.

  • How to manage documents using Cocoa's document-based application architecture. The Cocoa frameworks provided a lot of the basic behavior for free; such as managing common menu items, naming untitled documents, positioning new windows, and so on. You needed to fill in some key details to pull the whole thing together, including how to interpret your document files, managing undo, and the actual business of binding your document data to its user interface.

  • How to extend existing Cocoa objects through subclassing. Interface Builder even works with your custom subclasses, providing a convenient way to extend existing controls like NSImageView and NSButton.

  • How to use the responder chain and the first responder to route menu commands to the active document. You also learned how to receive and forward events along the responder chain.

  • How to send and receive notifications using NSNotification and NSNotificationCenter. You can use these tools to track changes that aren't directly ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required