Cocoa Bindings 2: not too frustrating, really
If you thought it was cool to drag connections between GUI widgets and actions in a controller object when you first started using Cocoa, you’ll flip when you see this in action. Bindings really are just what they say they are: tell Interface Builder to connect this GUI widget to this part of the data model and, presto-chango, no significant glue code.
I have a little PyObjC application that is coming along quickly thanks to cocoa bindings. My first PyObjC app took me weeks to figure out (partly due to the lack of cocoa object knowledge) and is several hundred lines of code. This app was started a few days ago, is considerably more complex, is nearly finished, and is barely any code.
Info regarding dead-ends I hit and how I’ve gotten this to work for me will be posted here soon. I may post a pseudo-wiki sort of thing that clarifies some of the things I found confusing while trying to use this in a real application. For now, here are links to the tutorials I’ve found most helpful:
This one is dirt simple, but clarifies a lot of the voodoo involved:
http://bob.pythonmac.org/archives/2004/04/04/pyobjc-nstableview-cocoa-bindings-tutorial/
This one is down right now, but was up yesterday. I assume they’re having temporary problems. This is a bummer as this tutorial shows one how to get and set values directly in the data model without a controller object.