Re: devil of a time with an NSImageView
Re: devil of a time with an NSImageView
- Subject: Re: devil of a time with an NSImageView
- From: Jean-Daniel Dupas <email@hidden>
- Date: Thu, 20 Aug 2009 15:37:42 +0200
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 (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