• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to indent in NSOutlineView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >How to indent in NSOutlineView? (From: "Aman Alam" <email@hidden>)
 >Re: How to indent in NSOutlineView? (From: "Aman Alam" <email@hidden>)

  • Prev by Date: Re: How to indent in NSOutlineView?
  • Next by Date: Re: Debugging strategy - exceptions
  • Previous by thread: Re: How to indent in NSOutlineView?
  • Next by thread: Removing folder from /Applications
  • Index(es):
    • Date
    • Thread