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
1
vote
0 answers

NSOutlineView grouping via bindings

This is sort of a best practice question, since I can think of a few ways that would work. I want to implement an outline view. Let's suppose I want to implement the one in OmniFocus (my aim is very similar): (I refer to the outline view in the…
Amy Worrall
  • 16,250
  • 3
  • 42
  • 65
0
votes
1 answer

Why does the row at the bottom of my outline view get deleted when I click the remove button rather than the one that is selected?

When I select a row in my outline view (connected to a NSTreeController) and click the remove button it doesn't delete the row that I have selected but actually deletes the row at the bottom of the table. For some more information here is my…
Joshua
  • 15,200
  • 21
  • 100
  • 172
0
votes
1 answer

What does AlwaysUsesMultipleValuesMarker do in NSTreeController?

According to Apple's documentation, setAlwaysUsesMultipleValuesMarker: Sets whether the receiver always returns the multiple values marker when multiple objects are selected, even if they have the same value. -…
Tony
  • 36,591
  • 10
  • 48
  • 83
0
votes
1 answer

NSTreeController: custom behavior for "canInsert" binding

I have a Cocoa app with an NSOutlineView managed by an NSTreeController. In addition there's a button for adding new elements to the outline view. I bound the button's enabled flag to the tree controller's canInsert property. I only want to allow…
0
votes
1 answer

Understanding and Reproducing the KVC Hillegass Way to Insert/Remove Objects in/from Controllers

In Aaron Hillegass' Cocoa Programming for Mac OS X, the Raiseman application connects a button in Interface Builder (IB) to an NSArrayController with sent action -remove:. In the MyDocument class he implements two KVC methods: -…
0
votes
1 answer

Cocoa - Displaying Nested Arrays in a Table View

I have a tree controller bound to an array, called "content". "content" is an array of model objects, called "Car". Each "Car" contains an NSString called "carName" and an NSMutableArray called "mostPopularColors". "mostPopularColors" contains…
0
votes
1 answer

NSTreeController does not respond to reloadData

I have a NSTreeController with bindings to a class. NSOutlineView dirTree binds to the NSTreeController In particular Outline View Content binds to arrangedObjects This appears to work well, but I am at my wits end to figure out why it does not…
Milliways
  • 1,265
  • 1
  • 12
  • 26
0
votes
1 answer

creating a NSOutlineViewController associated to a NSTreeController

I try to take example on the apple sample "Navigating Hierarchical Data Using Outline and Split Views". I made a app with SplitViewController, I put an NSOutlineView in the left pane and in the NSOutlineViewController, I added a NSTreeController. I…
0
votes
0 answers

How to add isLeaf and children to NSManagedObjects to use with a NSTreeController?

I am trying to use NSManagedObjects with an NSTreeController and NSOutlineView in my macOS app. I have a two level data in the outline view: Project and Item, both are NSManagedObjects set up in my model. In my storyboard, I added this: And I…
koen
  • 5,383
  • 7
  • 50
  • 89
0
votes
1 answer

View Based NSOutlineView Drawing Child Views Atop Parent Views

Using NSOutlineView + NSTreeController + Core Data is resulting in odd outline view layout. As you can see in the images below, the outline view creates a space for the 'Child' when the 'Parent' is expanded but instead draws the 'Child' on top of…
papahabla
  • 1,448
  • 18
  • 18
0
votes
1 answer

Expand item in NSOutlineView with NSTreeController

I'm trying (unsuccessfully) to get the node from a disclosure button clicked I think this function is the more appropriate: func outlineViewItemDidExpand(_ notification: Notification) { let nodeToExpand = notification.userInfo as! Node …
user14861636
0
votes
1 answer

NSTreeController with editable contents

I've got what (I would think) is an extremely simple case where an NSTreeController is bound to an array of root objects, each of which might have a few child objects. I am using an NSBrowser to show them. They display fine and the hierarchy is…
0
votes
1 answer

How do I set TreeController's Content Object when showing a NSXMLDocument in Outline View

I would like to show a NSXMLDocument in Outline View. Thankfully apple has a document for that called "Using Tree Controllers With NSXML Objects". But one thing I did not get is that how I set TreeController's Content Object. Firstly I set "Bind to"…
Qiulang
  • 10,295
  • 11
  • 80
  • 129
0
votes
1 answer

NSTreeController's selectionIndexPaths updating after mouseDown is often interrupted

Problem Background: I have a NSOutlineView with every tableColumn binded programmatically to the NSTreeController's arrangedObjects so there is no need to bind selectionIndexPaths. The source of NSTreeController's arrangedObjects is a mutableArray.…
0
votes
1 answer

NSTreeController - malloc double free error

I'm using an NSTreecontroller in conjunction with an NSOutlineView in my program, and my program is constantly spitting out: malloc: *** error for object 0x1d70d0: double free. These messages go away when I remove the bindings in IB. Any idea why…
Rich Catalano
  • 1,147
  • 1
  • 14
  • 23
1 2 3
8 9