Cocoa Programming for OS X: The Big Nerd Ranch Guide
by Aaron Hillegass, Adam Preble, Nate Chandler
Debugging Bindings
Bindings are a powerful feature of Cocoa, but they are notoriously difficult to debug. To a new Cocoa developer (and indeed even to the experienced), they can be quite mysterious. Because they are generally configured in the XIB file it can be difficult to track down the source of a problematic binding. Additionally, because they use strings, the compiler cannot help you by checking that the key actually exists on the object you are attempting to bind to.
The most common problem in using bindings is a key name typo, followed closely by binding to the wrong object. You will see this error at runtime when the related NIB file is opened: an exception will be logged to the console. There will be a couple dozen lines ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access