20. Bindings: Wiring an OS X Application

If you have another look at Figure 19.1, you’ll see that even in the abbreviated form Mac Passer Rating will take, there will be more than 20 pieces of information distributed across 4 displays, to be filled in, edited (in some cases), and coordinated across updates. This is going to involve some tedious, repetitive code and a lot of communications infrastructure through the network of objects, isn’t it?

Not as much as you’d think. AppKit (the Mac-specific part of Cocoa) offers a facility called bindings, supplemented by NSController classes, which are subtle when you first encounter them, but once you master them, can cut your coding burden by an order of magnitude.

Note

Experienced Mac programmers—and ...

Get Xcode 6 Start to Finish: iOS and OS X Development, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.