I'm working on an app right now that needs to use bindings as glue code from the controller. I found this tutorial which bound an NSStepper
and NSTextField
to a model and it works fine. The problem is that I need to do this programmatically, but it's a bit confusing.
What I've done in my controller class:
[self bind:@"contentObject"
toObject:_model
withKeyPath:@"self"
options:nil];
where _model
is my model. But then, if I do this:
[someKVCObject bind:@"value"
toObject:self
withKeyPath:@"selection.somethingInMyModel"
options:nil];
It doesn't work as I expect.
Can someone explain to me like I'm five what the selection
part is for an NSObjectController
and how I can make it work like the tutorial does so that it references the model object?