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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to