• 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
Re: Difficulties with NSWindowController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Difficulties with NSWindowController


  • Subject: Re: Difficulties with NSWindowController
  • From: Greg Titus <email@hidden>
  • Date: Mon, 18 Jun 2001 20:18:38 -0700

On Monday, June 18, 2001, at 06:46 PM, Rob Rix wrote:

Hi, all.
I'm implementing a non-document based GUI app. It's got a New command to allow you to open multiple windows. I have the New command connected to a custom object (MetaAppController) with the action newWindow:.
I have the window in a separate nib file to (I thought) facilitate having it open multiple times.

In newWindow:, I alloc an instance of NSWindowController, and use initWithWindowNibName: to have it load the appropriate nib file. Only difficulty is that although it appears to load the nib fine, it doesn't get the window properly. That is, [theController window] returns nil instead of the window from the nib file that theController loaded.

So, how do I remedy this?

Well, forgive me if this is too obvious, but have you connected the "window" outlet of the "File's Owner" object in your nib to the window in the nib? (In order to do that, you'd first need to select the file's owner, and set its custom class (cmd-5) to NSWindowController in order for IB to know that the owner _has_ an outlet named "window".)

Hope this helps,
--Greg


  • Follow-Ups:
    • Re: Difficulties with NSWindowController
      • From: Rob Rix <email@hidden>
References: 
 >Difficulties with NSWindowController (From: Rob Rix <email@hidden>)

  • Prev by Date: Object ownership question
  • Next by Date: Re: Object ownership question
  • Previous by thread: Difficulties with NSWindowController
  • Next by thread: Re: Difficulties with NSWindowController
  • Index(es):
    • Date
    • Thread