• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Mulitple controllers being made
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Mulitple controllers being made


  • Subject: Mulitple controllers being made
  • From: Mark Dawson <email@hidden>
  • Date: Thu, 27 Jul 2006 20:38:06 -0700

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

  • Follow-Ups:
    • Re: Mulitple controllers being made
      • From: John Terranova <email@hidden>
  • Prev by Date: Re: Releasing Objects Allocated in Different Autorelease Pool
  • Next by Date: NSTableView - Programmatically creating Table Columns and populating
  • Previous by thread: Re: Releasing Objects Allocated in Different Autorelease Pool
  • Next by thread: Re: Mulitple controllers being made
  • Index(es):
    • Date
    • Thread