NSWindowController and isWindowLoaded

Posted by Jim on Stack Overflow See other posts from Stack Overflow or by Jim
Published on 2010-05-17T17:44:49Z Indexed on 2010/05/17 17:50 UTC
Read the original article Hit count: 281

Filed under:
|
|

Hi,

I have an NSWindowController and I initialize it like this;

+ (MyWindowController *) sharedController
{
    static MyWindowController *singleton = nil;

    if (!singleton) singleton = [[self alloc] initWithWindowNibName: @"myWindow"];
    return singleton;
}

and I show windows like this;

[[MyWindowController sharedController] showWindow: nil];

Now the problem is that I need information from some controls on that window. But I do not want to load the window if it's not yet loaded because then I can just go with the defaults. Should I use @property to access the singleton? or what is recommended here? (If @property, then please give me the readonly, nonatomic attributes too.)

© Stack Overflow or respective owner

Related posts about nswindow

Related posts about objective-c