Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6054245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:07:52+00:00 2026-05-23T08:07:52+00:00

How do I put a window in a separate NIB, give it its own

  • 0

How do I put a window in a separate NIB, give it its own NSWindowController, make it slide out as a sheet?

(Is this a typical thing to do with sheets?)

I am trying to show a custom sheet (a window that slides down from the title bar of the parent window) from my main window. What I’m trying to do is standard, I think, but I cannot find clear examples or explanations for how to do exactly what I want.

What I am trying to do:

  1. My app delegate owns the main window, which has a button to open a “settings” sheet.
  2. The “settings” sheet:
    • is in a separate NIB.
    • has file owner set to class SettingsWindowController, which is subclass of NSWindowsController
  3. When user clicks “settings”, I am trying to use Apple’s [sample code][1]
- (void)showCustomSheet: (NSWindow *)window
// User has asked to see the custom display. Display it.
{
    if (!settingsSheet) 
    //Check the settingsSheet instance variable to make sure the custom sheet does not already exist.
        [NSBundle loadNibNamed:@"SettingsSheet" owner: self];
        //BUT HOW DOES THIS MAKE settingsSheet NOT nil?

    [NSApp beginSheet: settingsSheet
            modalForWindow: window 
            modalDelegate: self 
            didEndSelector: @selector(didEndSheet:returnCode:contextInfo:) 
            contextInfo: nil]; 

    // Sheet is up here.

    // Return processing to the event loop
} 

Please excuse the following simplistic and numerous questions:

  • When I call, loadNibName:owner:, I don’t want owner to be self, because that makes my app delegate the owner of the “MyCustomSheet” – that’s what my SettingsWindowsController is supposed to be for. However, I don’t know how make SettingsWindowsController the owner in this method.
  • If my sheet has “Visible at launch” checked, then loadNibName:owner: immediately displays the window as a normal window, not as a sheet that slides out from the main window.
  • If my sheet has “Visible at launch” not checked, then beginSheet:modalForWindow:etc causes “Modal session requires modal window”. I’m pretty sure this is because I made the Nib’s owner self (as I mentioned already).
  • In the sample code, I don’t know how the Nib named @”SettingsSheet” is “associated” with the instance variable settingsSheet – but they apparently are related because the code checks first: if (!settingsSheet) (I’ve marked this with comment //BUT HOW DOES THIS MAKE settingsSheet NOT nil?)

Thanks for your patience in reading all this!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:07:53+00:00Added an answer on May 23, 2026 at 8:07 am
    1. Create an instance of SettingsWindowController, use initWithWindowNibName:

    2. You don’t want it visible at launch.

    3. See 1.

    4. Your instance variables will be available to SettingsWindowController

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I defined a Window in WPF, into this one I put a stack panel
I want to put this in my website <script type=text/javascript> <!-- window.onload = hello;
If I put a window.alert on a webworker client, then the background worker stops
I have a Window where I have put a Frame. I would like to
I have put together the following mootools script window.addEvent('domready', function() { var shouts =
I'm trying to put standard output from nmap into WPF window application (textbox exactly).
I got an out put on my Windows command line when I execute the
Using the Apple OS X Cocoa framework, how can I post a sheet (slide-down
I basically need to show a wait window to the user. For this i
i'm currently using File::Basename fileparse to separate out a file's directory, base file name

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.