makeWindowControllers Problem

jove

Member
Hello,

I am writing a Cocoa app. When I use the document's windowNibName method, the NIB loads great.
Code:
- (NSString*) windowNibName
{
    return @"MyDocument";
}
When I override makeWindowControllers to instantiate more NSWindowControllers, no outlets are linked!
Code:
- (void)makeWindowControllers
{
    NSWindowController* controller = NULL;
    controller = [ [ NSWindowController alloc ] initWithWindowNibName: @"MyDocument" owner: self ];
    [ self addWindowController: controller ];
}
What am I doing wrong?
 
When called with the above sample It became recursive. I ended up killing the 'Document as file owner NIB'. All the other controllers work with your suggestion, thank you.
 
There just are not any good code examples of multi-window document or even instructions beyond the too simple statement of "override makeWindowControllers."

Although the NIB files are loading, I cannot show the windows. The app acts like the document never loaded (creates new on activation). Would you mind supplying a basic sample of the proper methods to override and implement to achieve what the framework is expecting. I am lost.
 
Back
Top