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
0
votes
1 answer

Xcode9 Swift4.2 NSOutlineView NSTreeController data

I am trying to create an outlineview in a MacOS app that has mutliple levels that are summaries for a set of data held in SQLite3. I have an outlineview working with a treecontroller with a very simple NSMutuableDictionary based on a model…
Mooky
  • 23
  • 4
0
votes
1 answer

In a macOS Cocoa application, How to show only the first 'x' elements that match a NSPredicate in a NSOutlineView populated with a NSTreeController?

I am developing a macOS proof of concept project. I have, in the main window, a NSOutlineView populated with a NSTreeController via Cocoa bindings and Core Data. Under the NSOutlineView, I have a search field and a "Recents" button, a bit like Xcode…
Alfonso Tesauro
  • 1,730
  • 13
  • 21
0
votes
2 answers

Is there no way to use IB and the relationship of two entities to populate an OutlineView?

I have touched on this question in others before but after writing an answer to a previous question there got me wondering why this isn't possible - or am I missing the fact that it might be? Given that Interface Builder is very good at graphically…
biscuitstack
  • 11,591
  • 1
  • 26
  • 41
0
votes
1 answer

Editable OutlineView with Cocoa Bindings

How do you bind the NSOutlineView (or NSTableView) so that the items can be editable? I know that there's the editable field for it but I'm not sure how to use it so any help for it would be nice. I have a NSTreeController that's bind to a…
0
votes
0 answers

What is the best way to store the state of NSTreeController contents in Swift?

I've built the custom NSOutlineView with NSTreeController, and I faced with the huge complexity of saving its state. Usage of Core Data is too tedious since I have implemented drag and drop support as well. So my question is more general. What is…
0
votes
0 answers

Setting TreeController childrenKeyPath throwing error

I am trying to set up an NSOutlineView using a TreeController. I have the following class for each node in the tree: @objc class EdLevel: NSObject{ @objc dynamic var isLeaf: Bool { return children.count == 0} @objc dynamic var childCount:…
Steven Lord
  • 253
  • 4
  • 15
0
votes
1 answer

Swift 4 NSTreeController @objc dynamic var nodes = [Node]() crashes app on start

After Swift 4 migration, my NSTreeController project now crashes on start. I boiled it down to the casting of @objc to my dynamic array. Does anyone have any idea why it keeps causing the crash? @objc dynamic var nodes =[Node]() // The @objc is…
David
  • 101
  • 8
0
votes
1 answer

How do you store child NSTableView settings for each parent item?

What is the best way to store an NSTableView's settings (ideally leveraging its autosave capability) for each item in its parent NSTreeController? I'm basically looking to reproduce the way iTunes stores the column settings for each playlist…
Dov
  • 15,530
  • 13
  • 76
  • 177
0
votes
0 answers

How do I save the order of sourcelist items?

I have an NSOutlineView as a sourcelist, like Mail.app. Its content is bound to an NSTreeController, which manages an array of my model objects. I've implemented drag-and-drop on the sourcelist and this is working perfectly. Now I'd like to save…
jeff-h
  • 2,184
  • 1
  • 22
  • 33
0
votes
1 answer

Overriding arrangedObjects of NSTreeController

In my project an NSTreeController is bound to an NSOutlineView(cocoa binding). For some reason I can't use NSPredicate to filter data from Core Data. So I tried to override arrangedObjects of NSTreeController, but the overriding arrangedObjects has…
LShi
  • 1,500
  • 16
  • 29
0
votes
1 answer

`NSTreeController`'s `arrangedObjects` doesn't respond to `children`

In the NSTreeController's arrangedObjects doc it says: The value of this property represents a proxy root tree node containing the tree controller’s sorted content objects. The proxy object responds to children and descendant(at:) messages.…
LShi
  • 1,500
  • 16
  • 29
0
votes
3 answers

Getting NSTreeController Data on NSOutlineView selection

I've built an NSOutlineView that gets dynamically updated data from an NSTreeController and that all works fine. What I can't seem to do is work backwards from there based on a user selection in the NSOutlineView. var deviceStore =…
Davidgs
  • 411
  • 6
  • 18
0
votes
1 answer

NSOutlineView bound to NSTreeController (nodes collapse on window resize)

I can successfully bind an NSTreeController to an NSOutlineView with Interface Builder. And when I try to do the same thing programmatically, I can also get it to work except for one little problem. Resizing the window, to which the outline view is…
0
votes
0 answers

Creating custom Cell in NSOutlineView which uses Core Data IB Bindings

I have an NSOutlineView that displays a hierarchy of folders taken from a Core Data entity using IB Bindings. The NSOutlineView NSTableColumn is bound to an NSTreeController. Each cell when clicked displays details in a CollectionView from an IB…
0
votes
1 answer

Refreshing NSTreeController from CoreData

I am developing a cocoa app which has NSOutlineView which is binded to NSTreeController with CoreData integration. For some purposes, I am deleting some of the nodes in NSTreeController…
emreoktem
  • 2,409
  • 20
  • 36
1 2 3
8 9