Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Struggling with NSOutlineView

Struggling with NSOutlineView
Thread Tools
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status: Offline
Reply With Quote
Apr 13, 2002, 02:23 PM
 
I'm having some problems getting started with NSOutlineView. I have set it up in IB and have assigned the data source to my general controller object. I'm at the point of overriding these methods in my controller:

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
- (id)outlineView NSOutlineView *)outlineView child int)index ofItem id)item;
- (BOOL)outlineView NSOutlineView *)outlineView isItemExpandable id)item;
- (int)outlineView NSOutlineView *)outlineView numberOfChildrenOfItem id)item;
- (id)outlineView NSOutlineView *)outlineView objectValueForTableColumn NSTableColumn *)tableColumn byItem id)item;
</font>[/code]


I want to have the outline view contain a list of 'folders' that can contain sub-folders as well as one type of custom object (call it customObject as it's not really important what it is). Sub-folders can have sub-folders and on and on. I can't figure out the best way to set up the data structures. Should I use an array containing other arrays and customObjects with each internal array containing arrays and customObjects? And then I'm not sure how to fit it into the above methods. I can't quite get a feel for how the first and fourth methods above relate to one another. I can probably figure out the second and third methods once I understand the data structure and the first and fourth methods.

Thanks for any help,
kman
     
Fresh-Faced Recruit
Join Date: Apr 2002
Location: France
Status: Offline
Reply With Quote
Apr 18, 2002, 03:14 PM
 
Have a look at the Example in
/Developer/Examples/AppKit/DragNDropOutlineView

or if you have the last Dec2001 tools, there are one more example on NSOutline view in the /Developer/Examples/AppKit/ folder.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:45 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2