Calling setFrameAutosaveName
Calling setFrameAutosaveName
- Subject: Calling setFrameAutosaveName
- From: Phill Kelley <email@hidden>
- Date: Mon, 26 Apr 2004 23:17:59 +1000
I have just stumbled across something strange. The normal sequence of
messages when an NSWindowController starts up is:
1. initWithWindowNibName (or some flavor thereof)
2. awakeFromNib
3. windowDidLoad
So far, so good. If, however, I include a call to setFrameAutosaveName: in
initWithWindowNibName, the sequence changes to:
1. Statements in initWithWindowNibName prior to setFrameAutosaveName:
2. awakeFromNib
3. windowDidLoad
4. Statements in initWithWindowNibName after setFrameAutosaveName:
In short, setFrameAutosaveName: appears to invoke awakeFromNib and
windowDidLoad prematurely.
Implicitly, this seems to be saying "don't call setFrameAutosaveName in an
init~ method, the proper place is awakeFromNib". Now that I've been smacked
between the eyes by this, I can accept that init~ is a pretty dumb place to
make this call. But the thing is that I can't actually find this
restriction documented anywhere. Does anyone know if it is documented, or
if it is one of those things that one just has to find out the hard way?
The main reason why I ask is that the behavior raises the possibility that
there may be other dos and don'ts of this kind, which may be clearly
documented somewhere and understood by everyone else, but that I have yet
to stumble across the relevant information.
So, if the documentation exists, I'd really appreciate it if someone could
point me at it.
Phill
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.