[MacRuby-devel] programatic binding (undefined bind method on NSTextField)

Alex Greif alex at greifdesign.net
Tue Sep 27 13:22:53 PDT 2011


I want to bind my NSTextField to my model object. In objective-c I would
do something like
[mytextfield bind:@"value" toObject:myperson withKeyPath:@"address"
options:nil];

But I have problems doing this in MacRuby with the following snippet:

mytextfield = NSTextField.alloc.initWithFrame [20, 200, 200, 20]
mytextfield.bind('value', toObject:'myperson', withKeyPath:'address')

It says that NSTextField does not have a bind method.

Do I misunderstand something, or is the bind method really missing and I
have to set/remove the observers all myself?

Thanks,
ALex.




More information about the MacRuby-devel mailing list