Phantom views? was RE: [Newbie] Uninitialized outlets?
Phantom views? was RE: [Newbie] Uninitialized outlets?
- Subject: Phantom views? was RE: [Newbie] Uninitialized outlets?
- From: Brian Hook <email@hidden>
- Date: Thu, 06 Sep 2001 10:13:37 -0700
I've looked into this a bit more. Something I just discovered is that
my custom view's -initWithFrame and awakeFromNib methods are called
twice, with two different "self" values. The call stack on each method
invocation is identical though:
- [MyView initWithFrame:]
- [NSCustomView nibInstantiate]
- [NSIBObjectData instantiateObject]
- [NSIBObjectData nibInstantiateWithOwner:topLevelObjects:]
loadNib
+ [NSBundle(NSNibLoading) _loadNiFile:nameTable:withZone:owner]
+ [NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone]
+ [NSBundle(NSNibLoading) loadNibNamed:owner:]
NSApplicationMain
main
What's interesting is that only the first invocation of -awakeFromNib
has a valid "m_pController" field.
Why would my view's -initWithFrame method get called twice? As far as I
can tell, I only have a single custom view instantiated in my window
(VERY simple window -- custom view, one text field and one button).
I went ahead and deleted the custom view from my window and Instances
Pane and re-instantiated it, reconnected everything, dragged a new
custom view into the window, etc. just to make sure there were no
phantom instances.
Thanks,
Brian