Search code examples
cocoacocoa-bindingsnsbox

How to set title of NSBox from an array controller via cocoa- bindings


I have an array controller holding some values, say - subjects. I am displaying these values in a table view. I want to set the title of NSBox as subject in selected row.

I tried to do it in following way: Binding pane: Title, Controller Key: selection, Model Key Path: subject.

But it is always displaying nil as box title.

Can anyone suggest me how to do it correctly?

Thanks,

Miraaj


Solution

  • This sounds like the correct approach. Tried to reproduce and it worked. A NSArrayController, and a NSBox wich title is bound to the arrayController with controller key set to selection, and modelkey to name (or whatever). No problem

    Are you sure you have choosen the right object to bind to?

    Try to do the same with a text object, and bind the value