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

Re: NSWindowController


  • Subject: Re: NSWindowController
  • From: Graham Cox <email@hidden>
  • Date: Tue, 16 Sep 2008 13:22:46 +1000


On 16 Sep 2008, at 11:55 am, Chris Idou wrote:

- (IBAction)preferences:(id)sender {
 if (nil == preferencesController) {
   preferencesController = [[NSWindowController alloc]
     initWithWindowNibName:@"Preferences" owner:self];
 }
 [preferencesController showWindow:self];
}

In the NIB, the file's owner is a NSWindowController, and I have linked its window outlet to the Window.


I'm not sure if it's the cause of your problem, but you're using initWithWindowNibName:owner:, and passing 'self' as the owner. Yet you say that File's Owner is the Window Controller. It's not clear what 'self' is in this snippet, but it appears not to be the window controller but some higher-level object.

You should probably just change that to -initWithWindowNibName: so that the controller itself is the owner.


hth,


Graham

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSWindowController
      • From: Chris Idou <email@hidden>
References: 
 >NSWindowController (From: Chris Idou <email@hidden>)

  • Prev by Date: Re: NSWindowController
  • Next by Date: Re: NSWindowController
  • Previous by thread: Re: NSWindowController
  • Next by thread: Re: NSWindowController
  • Index(es):
    • Date
    • Thread