Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Mulitple controllers being made
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Mulitple controllers being made



I'm misunderstanding how to make a window from a document.

I thought the sequence was in my NSDocument I add:

 - (void)makeWindowControllers {
   my_MainWindowController *myController = [[my_MainWindowController allocWithZone:[self zone]] initWithWindowNibName:@"MainWindow"];
    [self addWindowController:myController];
    [myController release];

However, what I'm seeing is that two copies of "my_MainWindowController" are being made.  The creation in "makeWindowControllers" calls my init routine.  After makeWindowControllers routine completes, though, Cocoa's "ShowWindow" routine ALSO creates another copy.

In the object that was created from the makeWindowControllers call, none of my outlets are hooked up when -awakeFromNib is called (and _window is nil).  However, the object made from ShowWindow DOES have my outlets connected up.

What could I be doing wrong to have doube controllers being made?

Thanks,

mark
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.