Chapter 5. Application Kit

The Application Kit, also known as the AppKit framework, contains all the classes needed to build OS X GUI applications. This is the framework we used in our “Hello World!” example in Code Example.

AppKit is a very large framework and this book will not cover all the classes provided. I’ll introduce the concepts you need to get started and illustrate a few of the classes that every programmer uses for graphical interfaces.

Cocoa Key Principles

You need to understand a few key concepts before digging further into Cocoa. So far, we have looked closely only at the Foundation classes, which map fairly intuitively to concepts and library calls in other programming languages and programming environments. With Cocoa, we jump into unique concepts that are less intuitive.

Cocoa is a well-thought-out, well-designed, and very consistent API. To assure this consistency, a few key concepts underlie most of the API classes. By following the designed conventions, you will avoid spending a lot of time rewriting your code over and over.

Note

These Cocoa concepts and conventions are unfortunately not enforced in all the available frameworks. Some C-based frameworks were incorporated into Cocoa simply by adding an Objective-C wrapper, and these usually don’t follow the conventions as nicely as frameworks written directly in Objective-C.

Model-View-Controller Design Pattern

Ruby developers who have done any web development should be quite familiar with the model-view-controller (MVC) ...

Get MacRuby: The Definitive 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.