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

CoreData, SourceList and NSTreeController

Ok guys, here is my question. I would use CoreData + Source List + NSTreeController to create something similar to the source list of Finder (or iTunes if you prefer). My problem is that what I have in my source list doesn't come entirely from…
2
votes
1 answer

Custom Hierarchy View-- NSTreeController or Not?

I have a hierarchy of stuff I want to display (at the same time) in both outline view and a custom view. Sort of analagous to the Buck and Yacktman (Cocoa Design Patterns) example in CH. 29, but with Outline instead of Table. I'll most likely have…
John Velman
  • 688
  • 9
  • 16
2
votes
0 answers

NSTreeController, arrangedObjects -- How does NSOutlineVIew Column get data from bindings?

Using XCode 4.2 with ARC. I'm trying to write a custom view for a hierachy of stuff. I'm using NSTreeController. I also have a standard outline view. My nodes have a property 'name' which is an NSAttributedString. In my standard outline view using…
John Velman
  • 688
  • 9
  • 16
2
votes
1 answer

Pointer to NSTreeController newly created item

Does anybody know of a good workaround or hack to get a pointer to the newly created node from an NSTreeController add: or addChild: method?
Gobot
  • 2,464
  • 1
  • 21
  • 26
2
votes
1 answer

Filtering a NSTreeController with NSSearchField ?

This question seemed to be asked before but was never answered. So is it possible to filter a NSTreeController with NSSearchField? If so, then how? Thanks!
Qiulang
  • 10,295
  • 11
  • 80
  • 129
2
votes
0 answers

how to get parent item of selected item outlineview Swift

I have multilevel hierarchy in my outlineview. I am able to get the selected item and it's parent item using below code. func outlineViewSelectionDidChange(_ notification: Notification) { guard let outlineView = notification.object as?…
Lakshmi Yadav
  • 156
  • 1
  • 10
2
votes
1 answer

NSTreeController with two different core data NSManagedObject entities

I am porting my iOS app to the Mac, and want to set up an NSTreeController to manage a hierarchy of entities. There are two distinct NSManagedObject types in this hierarchy, Group and Item, which have a one-to-many relationship (one Group to many…
Jason
  • 14,517
  • 25
  • 92
  • 153
2
votes
2 answers

How to remove all elements from NSTreeController with NSOutlineController

I am using NSTreeController with NSOutlineController to display contents in 1parent-1child hierarchy. My structure is like this: - parent - child - parent - child Now when user press a refresh button, I want to remove all the nodes and refill it…
2
votes
0 answers

NSTreeController KVO notifications unexpectedly not firing

I've encountered a bit of a poser involving NSTreeController and KVO. NSTreeController's selectionIndexPaths property is documented as being KVO-observable—and when I observe it directly, it works perfectly. However, if I list NSTreeController's…
2
votes
1 answer

NSTreeController get added child

When NSTreeController -(void)addChild:(id)sender is called, is there a way to get the NSManagedEntity that was created? The documentation mentions that the result of this method is deferred to the next loop run.
sharvey
  • 7,635
  • 7
  • 48
  • 66
2
votes
2 answers

Adding a child object using NSTreeController/NSOutlineView

In my application, like many Mac applications, I have a source list. At the moment this is an NSOutlineView bound to an NSTreeController. I can add items to it pretty easily, and have even been able to duplicate the "source list" appearance, with…
John Wells
  • 1,139
  • 1
  • 10
  • 27
2
votes
3 answers

NSTreeController fetch predicate based on transient isRoot exceptions

My document-based Cocoa application uses a NSOutlineView/NSTreeController combo, bound to the document's Core Data store. My NSTreeController has the fetch predicate isRoot == YES. isRoot is a transient boolean attribute with a default value of…
Adam Preble
  • 2,162
  • 17
  • 28
2
votes
2 answers

Setting the NSBrowserCell image using bindings?

I've got an NSBrowser hooked up to an NSTreeController bound to an array of NSTreeNode objects. It's easy enough to get the text portion working by setting the Content and Content Value bindings to properly reference the tree controller, but how do…
Redwood
  • 66,744
  • 41
  • 126
  • 187
2
votes
2 answers

Proposed solution to NSTreeController displaying duplicate entities

As many of you may know, an NSTreeController bound to an outline view can display duplicates while presenting core data entities. A temporary solution is to add 'parent == nil' to the predicates, but this only returns parent entities. If, for…
2
votes
1 answer

NSOutlineView not refreshing when objects added to managed object context from NSOperations

Background Cocoa app using core data Two processes - daemon and a main UI Daemon constantly writing to a data store UI process reads from same data store Columns in NSOutlineView in UI bound to an NSTreeController NSTreeControllers…
John Gallagher
  • 6,208
  • 6
  • 40
  • 75
1
2
3
8 9