• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Phantom views? was RE: [Newbie] Uninitialized outlets?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Phantom views? was RE: [Newbie] Uninitialized outlets?
      • From: "Erik M. Buck" <email@hidden>
References: 
 >Re: [Newbie] Uninitialized outlets? (From: Robert S Goldsmith <email@hidden>)

  • Prev by Date: Re: [Extreme Newbie] Cannot find class (factory) method
  • Next by Date: Re: -runModalForWindow and drawers
  • Previous by thread: Re: [Newbie] Uninitialized outlets?
  • Next by thread: Re: Phantom views? was RE: [Newbie] Uninitialized outlets?
  • Index(es):
    • Date
    • Thread