Re: How to instantiate WindowController in xib
Re: How to instantiate WindowController in xib
- Subject: Re: How to instantiate WindowController in xib
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Wed, 23 Nov 2016 01:01:54 +0700
> On 22 Nov 2016, at 21:45, Stéphane Sudre <email@hidden> wrote:
>
>
> On 22 nov. 2016, at 05:42, Gerriet M. Denkmann wrote:
>
>> My MainMenu.xib has an Object of class MainWindowController ← NSWindowController.
>>
>> The AppDelegate has a reference to this (mainWindowController).
>>
>> But
>> - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
>> {
>> NSLog(@"mainWindowController %@ windowNibName %@ windowNibPath %@",
>> self.mainWindowController, self.mainWindowController.windowNibName,
>> self.mainWindowController.windowNibPath);
>> }
>>
>> prints:
>> windowNibName = nil
>> windowNibPath = some totally unrelated xib file
>>
>> How to tell Xcode the WindowNibName to use ?
>
> the windowNibName property should be set by your subclass of NSWindowController (by implementing the - (NSString *) windowNibName; method usually).
This was the thing I missed. I had no idea that I had to override this method in my subclass of NSWindowController.
Now everything works as it should.
Thanks a lot for your help!
Kind regards,
Gerriet.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden