How do i make a simple view-based NSOutlineView?

horseyguy picture horseyguy · Apr 10, 2012 · Viewed 11.4k times · Source

For learning purposes i would like to convert a cell-based NSOutlineView to a view-based one,

basically i would like the following:

  • instead of a normal cell, i'd like an 'image and text table cell view'
  • the image can be the stock NSApplicationIcon and the text can just be 'hello world' :)
  • I'd like to do this without using bindings and NSTreeController

Here is the 'worlds simplest NSOutlineView' example http://www.cocoasteam.com/Cocoa_Steam/Worlds_Simplest_Demo.html

I wonder if someone could modify it to make it view-based and work like i said above :) :)

I've tried looking at apple examples, and searching elsewhere on the internet but i still can't get it to work - so thanks very much in advance :)

Answer

Besi picture Besi · Oct 11, 2013

I have created a little sample project which does just that.

  • Display a list of items
  • Edit the items in a master-detail fashion
  • Remove and add items
  • Usage of bindings

Check out besi/mac-quickies on github. Most of the stuff is either done in IB or can be found in the AppDelegate

screenshot