I have a Core Data model, which consists of a simple tree of a specific entity, which has two relations, parentand children. I have a NSTreeControllermodel manager, but NSOutlineViewattached to NSTreeController.
My problem is that I need one root object, but it should not be displayed as a structure, only its children should be displayed at the top level of the structure view. If I set the select predicate NSTreeControllerin Interface NSTreeControllerin parent == nil, everything works fine, except that the root element is visible as a top-level element in the form of a structure.
My entity has an attribute isRootItemthat is true only for the root element.
My model looks like this:
Node 1
|
+-Node 2
| |
| +-Node 5
|
Node 3
|
Node 4
The outline view should look like this:

(source: menumachine.com )
I need to display nodes 2, 3 and 4 at the top level of the schematic diagram (node 1 should not be visible), but their parent should be "Node 1". Node 1 matters YESto isRootItemand all the others have NO.
If I set the tree controller selection predicate to parent.isRootItem == 1, it displays the tree correctly, but as soon as I add a new element to the top level, it crashes because the tree controller does not designate the "invisible" root element as the parent of the new element.
NSTreeController/NSOutlineView ?