Questions tagged [nsoutlineview]

NSOutlineView is a subclass of NSTableView that uses a row-and-column format to display hierarchical data that can be expanded and collapsed, such as directories and files in a file system. A user can expand and collapse rows, edit values, and resize and rearrange columns.

Like a table view, an outline view does not store its own data, instead it retrieves data values as needed from a data source to which it has a weak reference (see Communicating With Objects). See the NSOutlineViewDataSource protocol, which declares the methods that an NSOutlineView object uses to access the contents of its data source object.

An outline view has the following features:

  • A user can expand and collapse rows.

  • Each item in the outline view must be unique. In order for the collapsed state to remain consistent between reloads the item's pointer must remain the same.

  • The view gets data from a data source (see the NSOutlineViewDataSource protocol).

  • The view retrieves only the data that needs to be displayed.

659 questions
30
votes
2 answers

NSOutlineView - Auto-expand all nodes

I've got an NSOutlineView bound to an NSTreeController (if that makes a difference), and I'd like to expand every node in my -awakeFromNib(). I'd also like to programatically select the first child of the first node at the same time. These sorts of…
Rich Catalano
  • 1,147
  • 1
  • 14
  • 23
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
24
votes
6 answers

How do you add context senstive menu to NSOutlineView (ie right click menu)

How do you add the ability to right click on a row in an NSOutlineView so you can say delete an object or some other activity. (ie Like when you right click on a folder in the Apple Mail app) I think I am half way there, I have a subclass of…
Jay
  • 19,649
  • 38
  • 121
  • 184
18
votes
4 answers

Strange behavior using view-based NSOutline (Sourcelist)

I have a (new in Lion) view-based NSOutlineView as Sidebar SourceList in my app using CoreData + NSTreeController + Bindings + NSOutlineView and an Object as NSOutlineViewDelegate. I use these delegate methods in the outlineview delegate: -…
Azpiri
  • 774
  • 1
  • 9
  • 20
17
votes
2 answers

Example of how to implement a view-based source list (NSOutlineView) using Cocoa Bindings?

Has anybody found a clear, concise example or guide on how to implement a source list using the view-based NSOutlineView introduced in Lion? I've looked at Apple's example project, but without any sense of direction or explanation, I'm finding it…
John Wells
  • 1,139
  • 1
  • 10
  • 27
17
votes
4 answers

Binding view-based NSOutlineView to Core Data

I'm trying to implement the new view-based OutlineView as a source list in my Mac app. I can't get values to display, though, so I made a small test app from the Core Data app template, and can't get it working right in there, either. I defined two…
Dov
  • 15,530
  • 13
  • 76
  • 177
17
votes
4 answers

NSOutlineView reloadItem: has no effect

I'm trying to release some strain on a view-based NSOutlineView for which I changed a single item property and which I initially reloaded just fine using [myOutlineView reloadData]. I tried [myOutlineView reloadItem: myOutlineViewItem] but it never…
Bertrand Caron
  • 2,525
  • 2
  • 22
  • 49
16
votes
4 answers

How to customize disclosure cell in view-based NSOutlineView

I'm trying to customize the disclosure arrow appearance in my view-based NSOutlineView. I saw that it's recommended to use - (void)outlineView:(NSOutlineView *)outlineView willDisplayOutlineCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn…
Nava Carmon
  • 4,523
  • 3
  • 40
  • 74
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
15
votes
3 answers

Layer hosting NSView within NSOutlineView

I am trying to create a custom NSView that hosts a CALayer hierarchy to perform efficient display. This NSView is then embedded within a NSTableCellView that is displayed by a View-Based NSOutlineView. The problem is that whenever I expand or…
Dalzhim
  • 1,970
  • 1
  • 17
  • 34
14
votes
6 answers

How to select items in NSOutlineView without NSTreeController?

I'm using NSOutlineView without NSTreeController and have implemented my own datasource. What is the best way to select an item? NSOutlineView support already expandItem: and collapseItem:. And I'm missing a handy method like `selectItem:. How can I…
cocoafan
  • 4,884
  • 4
  • 37
  • 45
13
votes
2 answers

NSOutlineView example

Please, could you give a simple complete example of Cocoa application with NSOutlineView with hierarchical data representation not so ambiguous like NSOutlineView and NSTreeController example . Thanks!
user663896
12
votes
2 answers

How to program a NSOutlineView?

I am having trouble creating a NSOutlineView in Xcode 8 (Swift 3). I have a plist file with some information that I would like to present in an OutlineView. The plist file looks as following (example): Root Dictionary *(1…
j3141592653589793238
  • 1,810
  • 2
  • 16
  • 38
12
votes
4 answers

How to get the source lists selection highlight to use the Dark Vibrancy appearance in OS X 10.10?

In OS X 10.10 source lists seem to use the light vibrancy appearance. In the Finder (and in some other third party applications, Things.app for example) the selected item in the source list is indicated by a dark vibrancy appearance. For example,…
Daniel Farrell
  • 9,316
  • 8
  • 39
  • 62
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
1
2 3
43 44