• 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: NSOutlineView initial expansion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOutlineView initial expansion


  • Subject: Re: NSOutlineView initial expansion
  • From: Ashley Clark <email@hidden>
  • Date: Thu, 4 Dec 2008 00:03:05 -0600

If your outline's data is being populated from an NSTreeController then the fetch isn't happening until the next iteration of the event loop. If I understand it correctly this is done so that it can present any errors as a sheet on your window.

Try delaying your call to expandItem: in your awakeFromNib.

- (void)expandAllItems {
	[outline expandItem:nil expandChildren:YES];
}

- (void)awakeFromNib {
	/* snip */

[self performSelector:@selector(expandAllItems) withObject:nil afterDelay:0.0];
}


I believe that should work.

Ashley


On Dec 3, 2008, at 3:36 PM, Andrew Shamel wrote:

I've trolled through the archives looking for help on this, but I can't seem to find anything that quite works. I'm trying to set it up such that an NSOutlineView starts out fully expanded. In the delegate, I have the following code:

- (void)awakeFromNib
{
	[outline expandItem:nil expandChildren:YES];
}

I feel like I'm missing something rather obvious, since the same code works when it's attached to a button. Is there a better place to put it than in awakeFromNib:?

Thank you so much both for your help and your patience.

Peace,

Andy

_______________________________________________

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


_______________________________________________

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


  • Follow-Ups:
    • Re: NSOutlineView initial expansion
      • From: Andrew Shamel <email@hidden>
References: 
 >NSOutlineView initial expansion (From: Andrew Shamel <email@hidden>)

  • Prev by Date: How to draw rounded Images
  • Next by Date: Re: NSOutlineView initial expansion
  • Previous by thread: NSOutlineView initial expansion
  • Next by thread: Re: NSOutlineView initial expansion
  • Index(es):
    • Date
    • Thread