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

  • Home
  • SEARCH
  • 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 96803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:53:00+00:00 2026-05-10T23:53:00+00:00

I have a nib that I load the usual way [NSBundle loadNibNamed:@AuthorizationWindow owner:self]; and

  • 0

I have a nib that I load the usual way

[NSBundle loadNibNamed:@'AuthorizationWindow' owner:self];

and I see the window show on the screen briefly, and using NSLog() I can confirm that -awakeFromNib is called, but I can’t figure out why the window does not stay on the screen. I had it working correctly for a bit, but now I’m not sure what I changed that messed it up. Thoughts of where to start looking?

  • 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. 2026-05-10T23:53:01+00:00Added an answer on May 10, 2026 at 11:53 pm

    I’d guess your window is being deallocated (or if under GC, collected) right out from under you. There are about a million possible reasons for this (none of which we can diagnose from one line of code), but there mere fact you’re using +loadNibNamed:owner: is a warning flag. The reason is that items instantiated in nibs follow the same memory management rules as the rest of Cocoa; if you want them to stick around, you have to retain them (or in GC, keep a reference to them). NSWindowController (and NSViewController too) has some special nib-handling code so that it retains all the top-level objects in its nib when it loads, so that they’ll stick around as long as it does*. However, if you don’t use that, you have to do all that manually.

    The real solution is: Don’t use +loadNibNamed:owner:. Instead, create an NSWindowController subclass and set up its -init method like so:

    @implementation AuthorizationWindowController - (id)init {     self = [super initWithWindowNibName:@'AuthorizationWindow'];     if (self == nil) return nil;     // any other initialization code     return self; } 

    *It also has special code to handle bindings-induced retain cycles that would normally cause it to leak, which is quite a bit more difficult to write yourself. Yet one more reason to use NSWindowController.

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

Sidebar

Related Questions

I have a UIViewController that I want to load from a NIB that has
I have a NIB file that I load using NSWindowController initWindowNibName. The NIB file
I've noticed that if you load connected views from a nib you have to
I have a NIB that contains a UIView. I have another NIB that contains
I have a NIB with a UIView that contains some UILabels, UIButtons etc. and
previously i had custom tableviewcell and was loading from Nib.in that i have specified
I have a ViewController that has its own NIB. I would like to embed
I have a custom NSWindowController subclass that loads a NIB file during initialization like
I have a table that I created within xcode so there is no nib
I have a simple custom view that is connected via outlet to a NIB.

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.