Creating a master-detail application using NSTreeController, NSArrayController and master data

I come from iOS and try to create the simplest OS-OS application with master details, but it's hard for me to migrate. In particular, I cannot understand how I integrate the main data using NSTableView using NSArrayController;

Currently, the application looks like this: Contacts app

My data model is as follows:

enter image description here

As you can see it is very simple. I want to be able to select a group in the source list on the left, and then display all containing Persons in the right view of the table.

I managed to connect NSOutlineView to a simple NSArray, but what is the best way to connect it to all Group objects using NSTreeController and make everything editable?

+5
2

NSArrayController Group ( GroupController). . Value GroupController, . , Controller Key arrangedObjects Model Key Path title.

NSArrayController (PersonsController). Content Set. GroupController , PersonsController GroupController. , Controller Key selection Model Key Path persons. , , PersonsController

PersonController. PersonController (firstName, lastName).

​​ Person.

EDIT: , , NSTreeController. , GroupController - NSArrayController - NSTreeController. . - , .

EDIT2: - Apple SourceView. , NSTreeController. NSDictionary, .

+3

All Articles