Le 20 août 2009 à 13:55, I. Savant a écrit :

On Aug 20, 2009, at 3:41 AM, Jean-Daniel Dupas wrote:

The -[NSWindowController loadWindow] methods says you can call - [NSWindowController window] to load the window, so I don't think it should be an issue..

Just a point, I think that in NSWindowController it may be better to initialize dependent stuff in -windowDidLoad, especially if you want to access the window object. I remember I encountered some issue using awakeFromNib some time ago but don't remember exactly what it was.

Hmmm ... I'd love to hear the details of the problem if you remember it. "Conventional wisdom" says -awakeFromNib. I haven't had the time yet to re-read the relevant docs to examine this more closely. Maybe later today.

I managed to find a issue when you don't bind the window outlet and try to call [self window] in awakeFromNib. Instead of returning nil, it try to load the nib again, falls in a infinite recursive loop and crash when the stack is full. That is the problem I encountered. Unlike NSViewController which require a view, NSWindowController does not enforce the window binding, and it even has a setWindow: method that you can use to attach a window to it (even if the doc says you should create a new window controller instead). I can't says if this problem hit me because I forget to bind the window, or if an OS update fixed this issue.

I didn't managed to reproduce it when the window outlet is bound though, so this should not be an issue. At least, not with the version of the OS I'm using.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to