Questions tagged [nstreecontroller]

The NSTreeController is a bindings compatible controller that manages a tree of objects. It provides selection and sort management. Its primary purpose is to act as the controller when binding NSOutlineView and NSBrowser instances to a hierarchical collection of objects. The root content object of the tree can be a single object, or an array of objects.

The NSTreeController is a bindings compatible controller that manages a tree of objects. It provides selection and sort management. Its primary purpose is to act as the controller when binding NSOutlineView () and NSBrowser () instances to a hierarchical collection of objects. The root content object of the tree can be a single object, or an array of objects.

132 questions
27
votes
8 answers

NSOutlineView: remove disclosure triangle and indent

I'm using NSOutlineView for a project, and can't seem to figure out two things: How to remove the disclosure triangle for tree nodes. Apps like iTunes seem to be able to do this: Is there some sort of NSOutlineView Delegate method that is used…
indragie
  • 18,002
  • 16
  • 95
  • 164
15
votes
2 answers

NSOutlineView jumps up to the top when content updates

I have an NSOutlineView that is displaying a directory hierarchy. It's bound to an NSTreeController, which is bound to my class that manages file system nodes. When a filesystem event occurs, I fire a KVO notification on the children keypath, which…
tbodt
  • 16,609
  • 6
  • 58
  • 83
12
votes
3 answers

NSOutlineView and NSTreeController example

Please send me some links on how to use NSOutlineView with NSTreeController bindings without using core data.
Bhanu
9
votes
2 answers

Given model object, how to find index path in NSTreeController?

Given model objects that NSTreeController represents, how do you find their index paths in the tree and subsequently select them? This seems to be a blindingly obvious problem, but I can't seem to find any reference to it. Any ideas?
Tony
  • 36,591
  • 10
  • 48
  • 83
9
votes
1 answer

How to bind NSTreeController's Children to Core Data ordered to-many-relationship?

Apple introduced ordered to-many-relationships in Core Data in Lion. I created an entity named TreeNode with an 1:1-object-relation, a 1:1-parent-relation and an ordered to-many-relationship children. Then I have an NSTreeController with the…
8
votes
1 answer

Using NSTreeController with NSOutlineView

I'm trying (unsuccessfully) to build a TreeController-controlled NSOutlineView. I've gone through a bunch of tutorials, but they all pre-load the data before starting anything, and this won't work for me. I have a simple class for a device: import…
Davidgs
  • 411
  • 6
  • 18
8
votes
1 answer

With NSTreeController, do I have to manually reload an NSOutlineView when changing the model array?

I have a tree-like model I'd like to show in an NSOutlineView using an NSTreeController. I was able to set up the bindings and everything works fine as long as I use the NSTreeController's insert and remove functions to change my model tree. If I…
DrummerB
  • 39,814
  • 12
  • 105
  • 142
4
votes
1 answer

Clean way to get the NSIndexPath of an object in an NSTreeController or NSOutlineView?

After poring through the documentation, I can find no reasonably easy way to get the index path of an object in an NSOutlineView or the NSTreeController it's bound to. As a result, I've ended up writing really ugly code trying to assemble an index…
John Wells
  • 1,139
  • 1
  • 10
  • 27
4
votes
1 answer

Programmatically binding NSTreeController to NSOutlineView

To support a different language than Swift and ObjC, I need to understand how to set up an NSTreeController for an NSOutlineView. I have already been able to create the NSOutlineView in code, along with providing my own DataSource delegate. But now…
Thomas Tempelmann
  • 11,045
  • 8
  • 74
  • 149
3
votes
1 answer

can NSTreeController setcontent be used with NSXMLDocument?

I'm trying to display the content of a simple plist (xml) file in an outlineview. Once I have the file data in either an NSXMLDocument or an NSDictionary, is it possible to just use this existing structure to populate the TreeController? All the…
3
votes
2 answers

Error with NSTreeController - this class is not key value coding-compliant for the key

I am new to Swift and trying to learn how to implement NSTreeController with NSOutlineView. I've been following several guides which shows such examples, but I keep getting an error. I followed step by step and/or try to run their source codes if…
Shu
  • 31
  • 3
3
votes
2 answers

"Ambiguous use of 'children'" when trying to use NSTreeController.arrangedObjects in Swift 3.0

I get an Ambiguous use of 'children' error in XCode 8.0/Swift 3.0 when trying to send a message to the opaque NSTreeController.arrangedObjects object. Here is a bare playground showing the use case : import AppKit extension NSTreeController { …
Bogdan Farca
  • 3,856
  • 26
  • 38
3
votes
2 answers

How do I use NSTreeController, NSOutlineView and Core Data with an "invisible" root item?

I have a Core Data model which consists of a simple tree of a particular entity, which has two relationships, parent and children. I have an NSTreeController managing the model, with an NSOutlineView bound to the NSTreeController. My problem is that…
Rob Keniger
  • 45,830
  • 6
  • 101
  • 134
3
votes
1 answer

NSOutlineView/NSTreeController not releasing all model objects after removing them

I have a very basic app: a window with an NSOutlineView bound to an NSTreeController. The outline view displays a simple model object (TCCard). I added two buttons so that I can add and remove model objects from the outline view. Looking at the app…
Mark
  • 6,647
  • 1
  • 45
  • 88
3
votes
1 answer

Setting up a NSTreeCcontroller for a NSOutlineView using CoreData

My Model looks like this: In my test project, I have the following two methods: - (void) addChildWithName:(NSString*)name toParent:(Item*)parent { static NSUInteger count = 1; Item* childItem; childItem = [NSEntityDescription…
ericg
  • 8,413
  • 9
  • 43
  • 77
1
2 3
8 9