Outline, tree and datasource

Discussion in 'Mac Programming' started by Miglu, Aug 24, 2011.

  1. Miglu macrumors member

    Jan 22, 2010
    I want to use NSOutlineview to show hierarchical data from a NSArray, but not from Core Data. I have not found a tutorial about it that does not use Core Data, but I guess that I should use NSTreeController and some object that implements NSOutlineViewDataSource. How to bind those three objects, and the array, together?
  2. GorillaPaws macrumors 6502a


    Oct 26, 2003
    Richmond, VA
    If you want to use bindings, you need to use the NSTreeController. I have heard bad things about implementing this strategy (although it may have improved since). It has been recommended to me to use the data-source delegate methods instead of bindings.
  3. Miglu thread starter macrumors member

    Jan 22, 2010
    Alright, I have implemented the 4 required delegate methods in NSOutlineViewDataSource. How to use it with NSOutlineview? I do not know, as I do not have much experience with views.
  4. Littleodie914 macrumors 68000


    Jun 9, 2004
    Rochester, NY
    Start by connecting the dataSource and delegate outlets of the NSOutlineView (in Interface Builder) to the object that is implementing those methods. Then fix the bugs as you hit them. :D

Share This Page