1

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.

Here's the tutorial.

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?

Justin Boo
  • 10,132
  • 8
  • 50
  • 71
anonymous
  • 19
  • 1
  • 1
    What does "doesn't work as expected" mean? What are your expectations, and what are the actual results? – jscs Jul 30 '11 at 04:18
  • I mean that it isn't actually changing the value of "somethingInMyModel" when "value" is changed. – anonymous Jul 30 '11 at 04:29

0 Answers0