Re: -beginSheet:modalForWindow:modalDelegate:didEndSelector
Re: -beginSheet:modalForWindow:modalDelegate:didEndSelector
- Subject: Re: -beginSheet:modalForWindow:modalDelegate:didEndSelector
- From: Kyle Sluder <email@hidden>
- Date: Fri, 20 Feb 2015 13:09:50 -0600
On Fri, Feb 20, 2015, at 12:54 PM, Raglan T. Tiger wrote:
> My App has one window which is displayed. I want to display a sheet when
> a button is clicked.
>
> In the action for the button click I do:
>
> ETAboutWindowController *windowController = [[ETAboutWindowController
> alloc] initWithWindowNibName:@"ETAboutWindowController"];
> [NSApp beginSheet:[windowController window] modalForWindow:[NSApp
> mainWindow] modalDelegate:nil didEndSelector:nil contextInfo:nil];
>
> The sheet displays like a modal window with no title bar rather than
> sliding down from the main widow as I expect and the spinning beach ball
> appears.
>
> What is my mistake here?
Inspect the "Display At Launch" checkbox for the window in the nib. If
that's set, the window will be immediately ordered in as soon as it's
decoded from the nib, which is obviously not what you want.
If that's what happened, file a bug against Interface Builder. This
trips up _everyone_, experienced and new alike.
--Kyle
_______________________________________________
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