Re: NSWindowController
Re: NSWindowController
- Subject: Re: NSWindowController
- From: Chris Idou <email@hidden>
- Date: Mon, 15 Sep 2008 20:44:27 -0700 (PDT)
That fixes it, but I thought the owner in this case was the owner of the NSWindowController, not the File's owner of the NIB.
NSWindowController has an "owner" property. But if you're saying the owner is the File's owner, which is the NSWindowController itself, then what is the owner property for?
--- On Mon, 9/15/08, Graham Cox <email@hidden> wrote:
> From: Graham Cox <email@hidden>
> Subject: Re: NSWindowController
> To: email@hidden
> Cc: email@hidden
> Date: Monday, September 15, 2008, 8:22 PM
> 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