Re: How to indent in NSOutlineView?
Re: How to indent in NSOutlineView?
- Subject: Re: How to indent in NSOutlineView?
- From: Jens Miltner <email@hidden>
- Date: Wed, 09 Jul 2008 13:46:49 +0200
Am 09.07.2008 um 13:09 schrieb Aman Alam:
I am using datasource that contain two types of object.
The first object (Heading) contains a flag. If it is YES then it act
as child of other main heading.
The second object(item) contains value to show which is always child
of main heading.
You don't tell us anything about the organization of your hierarchy,
so I assume that your datasource code looks something like this:
- (int)outlineView:(NSOutlineView *)anOutlineView
numberOfChildrenOfItem:(id)item
{
if ( item == nil ) return [headings count];
else return [[item childItems] count];
}
- (id)outlineView:(NSOutlineView *)anOutlineView child:(int)index
ofItem:(id)item
{
if ( item == nil ) return [headings objectAtIndex:index];
else return [[item childItems] objectAtIndex:index];
}
(assuming both your Heading and item objects have a method -
(NSArray*)childItems that returns the child items for that item and
your dataSource contains an array "headings" that holds the top-level
headings)
?
</jum>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden