tags:

views:

26

answers:

1

I made a program that has a checkbox and a textbox. If the user checks the checkbox then the textbox displays "you checked the checkbox." If the user unchecks the checkbox the textbox displays "you unchecked the textbox."

Is it possible to do the same thing with bindings? How?

+1  A: 

Have your controller object have a Boolean property, and bind the checkbox to that. Have the same controller have a string property depending on the Boolean property, and implement its getter to return one string or the other depending on the value of the Boolean property.

Peter Hosey
How do I give the controller object a Boolean property?
Phenom
Declare the property in the controller object's class's `@interface` and provide accessors for that property in the class's `@implementation`. http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocProperties.html
Peter Hosey