NSOutlineView - Adding data

Discussion in 'Mac Programming' started by satyam90, Apr 29, 2008.

  1. satyam90 macrumors regular

    satyam90

    Joined:
    Jul 30, 2007
    Location:
    Bangalore, India
    #1
    I am using Cocoa with Obj C. I am working on XCode 2.4.1
    I am having a NSArrayController object which holds a class Collections. Collections class is having different member variables and associated methods. "Type" is one variable in that
    Now I am using this NSArrayController object and binding it to NSTableView to populate necessary data in it.
    Now I want to change this to NSTableView to NSOutlineView so that I can have tree structure inside it. By using "Type" in my class object, can I bind (or some other method) to populate my NSOutlineView and show the classified data depending on "Type"
    For eg:
    Fruits
    Apple
    Banana
    Flowers
    Rose
    Lilly
    Birds
    Pegion
    Crow
    .
    .
    .
    Here Fruits, Flowers, Birds etc are "Types" in my Collections.
    Is it possible?
     
  2. MacDonaldsd macrumors 65816

    MacDonaldsd

    Joined:
    Sep 8, 2005
    Location:
    London , UK
    #2
    I don't think that is possible with bindings. If you want to do it without you have to use the NSOutlineViews delegate methods.

    http://developer.apple.com/document.../NSOutlineView_Class/Reference/Reference.html


    I think their is a NSOutlineView Example which gets installed along side Xcode.
     

Share This Page