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 1003331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:57:51+00:00 2026-05-16T07:57:51+00:00

I have an NSWindowController subclass called _PreferencesWindowController with the following implementation – @synthesize window;

  • 0

I have an NSWindowController subclass called _PreferencesWindowController with the following implementation –

@synthesize window;

- (id)init {

 self = [super initWithWindowNibName:@"PreferencesWindow"];
 if (!self) return nil;

 return self;
}

And I tried to show the window in _PreferencesWindowController by using the following code –

_preferencesWindowController = [[_PreferencesWindowController alloc] init];
[_preferencesWindowController showWindow:nil];

It does nothing, and I checked _preferencesWindowController.window is nil from the debugger.

However if I call loadView on _preferencesWindowController the window can be loaded and is visible; _preferencesWindowController.window is no longer nil-valued –

[_preferencesWindowController loadWindow];

I looked at Apple’s documentation on NSWindowController it specifically says “you should never directly invoke loadWindow“, instead showWindow: should be used. I’m wondering what I might have missed that resulted in the above-mentioned behaviour I have been seeing.

  • 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-16T07:57:52+00:00Added an answer on May 16, 2026 at 7:57 am

    OK I solved this by looking at the NSWindowController header file.

    The problem is in my header file for _PreferencesWindowController –

    @interface _PreferencesWindowController : NSWindowController <NSToolbarDelegate> {
    
        NSWindow *window;
    
    }
    
    @property (assign) IBOutlet NSWindow *window;
    
    @end
    

    By removing the @property declaration and changing NSWindow *window ivar to IBOutlet NSWindow *window, showWindow: method now works without a glitch.

    The property declaration must have resulted in an undefined behaviour in showWindow: method in NSWindowController‘s implementation.

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

Sidebar

Ask A Question

Stats

  • Questions 511k
  • Answers 511k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Your client can set the end-point in the service "port"… May 16, 2026 at 5:21 pm
  • Editorial Team
    Editorial Team added an answer I think your problem is with the following SET command… May 16, 2026 at 5:21 pm
  • Editorial Team
    Editorial Team added an answer Propagation is the issue here. When you click an image… May 16, 2026 at 5:21 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a simple Cocoa app using a NSWindowController subclass. In the nib I
I have a custom NSWindowController subclass that loads a NIB file during initialization like
I have a nib (winA.xib) that contains a window. My app delegate contains an
I've added a custom subclass of NSWindowController to my Cocoa project, and added an
As my Cocoa app comes along, my NSWindowController is becoming huuuuuuuuuuge . My window
Have following setup: MainActivity class - extends activity MyLayout class - extends View Prefs
I have a multithreaded application that has many concurrent operations going on at once.
I'm seeking further clarification after seeing What is responsible for releasing NSWindowController objects? I'm
I've had a crack at implementing bindings for my own NSView subclass. It works,
In the Implementation Overview section of the NSPersistentDocument Core Data Tutorial it says: …

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.