Pregunta

I have a standard Master-Detail Interface and I'm using Coredata and cocoa bindings.

The Master list uses a NSOutlineView and a NSTreeController, these items remain static but different details views are swapped in and out.

So, how do I set the content of the array controllers in the different detail views to correspond to the selection in the outlineview in the Masterview?

This is straight forward if all the array/treecontrollers are in the same .xib file. initially, I tried creating an Outlet from of the Treecontroller and passing this to the orther views as they are created, but I don't think this is correct.

Any suggestions?

¿Fue útil?

Solución

You can use an array controller or a tree controller for as many views as you like. In your specific example, I would make the masterview owner of the tree-controller (unless you have a compelling reason to go yet another level up). Then each detail view that gets swapped-in would also have view controllers. That controller would have an assignable "tree-controller" property that would get set before its view is loaded to the value of the "master" tree-controller. Within the Nib files you can use bindings (to the tree-controller of files-owner) as you normally would.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top