Daniel's Stuff

I write code

Cocoa bindings

I have to say that Cocoa bindings are one of the coolest things to some to Cocoa in a long time. 
It takes a bit of getting used to however, and the documentation isn’t the greatest. One of the things that had me stumped for a bit was how to have a button
s enabled flag depend on more than one edit field having a value. There was only one Enabled binding. It seems that Interface Build adds more Enabled bindings as you create them. So you add an Enabled binding, and all of a sudden in the bindings tab appears Enabled2. Add another one and what do you know Enabled3 magically comes into existence 🙂 
I spent a little while looking to see if there was some way of doing something like Enabled = IsNotNull(field1) and IsNotNull(field2) and IsNotNull(field3), when all I had to do was just add them in. 
 
 
 
It’s nice when the tools are smart like this, although it would also be nice if there was some documentation that said something like this would happen. I guess I should have know it would do that since it makes sense for it to do so. One of the nice things about Apple software is that it tends to just work (most of the time). 

Leave a Reply

Your email address will not be published. Required fields are marked *