arachide
arachide

Reputation: 8076

NSWindowController problem

I created a NSWindowController(.m.h) in a cocoa project. I set the outlet of the NSWindowController as the window(NSWindow) in MainMenu.xib,

I found that the functions in NSWindowController.m below

- (BOOL)isWindowLoaded;
- (void)windowWillLoad;
- (void)windowDidLoad;
- (id)initWithWindow:(NSWindow*)window;

only

- (id)initWithWindow:(NSWindow*)window;

was triggered, and the value of the parameter window is 0x0.

I do not what caused this happen.

Welcome any comment.

Thanks

interdev

Upvotes: 0

Views: 770

Answers (1)

grahamparks
grahamparks

Reputation: 16296

You need to set NSWindow's delegate connection to point to your controller, otherwise it won't receive those events.

Upvotes: 2

Related Questions