Saturday, August 4, 2012

Implementation of a tree structure in OSX - Step 4

Continuation of the tree structure implementation ..

First select Tree Controller object that we created and add these information as below.

Then select the outline view in the MainMenu.xlb then add these information as shown.

This shows that we are binding outline view to the tree controller using the commandName of the TreeNode. (You can refer to TreeNode.m )





















After that  select Tree Controller object and create the connection to the AppDelegate class. (You need to press ctrl key when creating the connection). Selecct treeController from the menu.


After that connect Appdelegate class to the Tree Controller as below. Selecct treeController from the menu.



Finally you have completed the implementation.

Then Build and Run the project. (Press Command + R)
You will have this...
I believe that this will need to somebody in someday just  like once I needed this .....


3 comments:

  1. Many thanks for these posts Suneth, they were a big help. If anyone needs another example (written with xcode 6) I have one here that builds a tree structure in an outline view using photo projects from Apple Aperture: https://github.com/soulflyer/aperture-outline-treeview

    ReplyDelete
  2. Hi,

    First of all, my version of Xcode is much newer than yours and there are many differences that I am having trouble with...mainly on this part 4. To me steps 3 and 4 appear to be identical. Actually, once step 3 is done, I can't perform step 4. Also, the screen shots are in such low resolution that I can't read the texts on them.

    Do you have a place where I could just download your finished example?


    PS I tried to compile the code from https://github.com/soulflyer/aperture-outline-treeview and get the following error:

    OSACompile Aperture.applescript
    cd "/Volumes/TOSHIBA EXT/XCode Examples/Objective-C Samples/aperture-outline-treeview-master"
    /usr/bin/osacompile -l AppleScript -d -o /Users/mmansfield/Library/Developer/Xcode/DerivedData/Aperture-Outline-Treeview-ftbyzihljkzedshdbajzhekhjjhn/Build/Products/Debug/Aperture-Outline-Treeview.app/Contents/Resources/Aperture.scpt Aperture.applescript

    Aperture.applescript:27: error: Expected class name but found property. (-2741)
    Command /usr/bin/osacompile failed with exit code 1

    ReplyDelete