• 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
Autolayout requiring NSDisableScreenUpdates
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Autolayout requiring NSDisableScreenUpdates


  • Subject: Autolayout requiring NSDisableScreenUpdates
  • From: Seth Willits <email@hidden>
  • Date: Sun, 30 Aug 2015 15:57:50 -0700

My window's UI mainly consists of a stack view, but in the window's xib, there's nothing in the stack view to begin with. This means that after the xib loads, the window is tiny (like 70 x40).

In windowDidLoad I'm adding views to the stackview which actually make it the "real" size it should be, once autolayout happens. The problem is that the window is already shown and visible on screen before the new layout even takes effect, which is requiring me to wrap xib loading in NSDisableScreenUpdates/NSEnableScreenUpdates.

Is there something else I could/should be doing? (Besides obviously having the window loaded from the xib be the correct size to begin with, which simply isn't possible.)



- (void)windowWillLoad;
{
	NSDisableScreenUpdates();
	[super windowWillLoad];
}


- (void)windowDidLoad
{
	[super windowDidLoad];

	< at this point, the window is already visible >

	...
	[stackView addView:view inGravity:NSStackViewGravityTop];
	...

	[self.window layoutIfNeeded];
	[self.window center];
	NSEnableScreenUpdates();
}



--
Seth Willits




_______________________________________________

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: Autolayout requiring NSDisableScreenUpdates
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: Impossible leak warning in OS X init method
  • Next by Date: Re: Autolayout requiring NSDisableScreenUpdates
  • Previous by thread: Re: Impossible leak warning in OS X init method
  • Next by thread: Re: Autolayout requiring NSDisableScreenUpdates
  • Index(es):
    • Date
    • Thread