• 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
Re: Strange problem showing a window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange problem showing a window


  • Subject: Re: Strange problem showing a window
  • From: James DiPalma <email@hidden>
  • Date: Fri, 28 Feb 2003 22:46:24 -0800

From: matt neuburg <email@hidden>
From: Angela Brett <email@hidden>

[NSBundle loadNibNamed:@"AboutBox" owner:self];
[[legendField window] makeKeyAndOrderFront:nil];

My guess is that you're calling [legendField window] too soon. After calling loadNibNamed:, you still don't know that the nib has actually been loaded and all the connections made until you get an awakeFromNib message. m.

I've been shaking my head for 15 minutes trying to figure out when nib loading got so confusing.

awakeFromNib _must_ be called before loadNibNamed: returns; all objects and code that know enough to call awakeFromNib can't do so after they return, and why would they bother trying? loadNibNamed: has a name that implies a nib will begin loading and finish loading during this method.

After calling loadNibNamed:, a nib file has finished loading and awakeFromNib has already been sent. Actually, I would not say a nib "has been loaded" during an awakeFromNib method.

BTW, here is a backtrace of when awakeFromNib is called (poseAs: classes removed and frame 5 left in even though I can't explain it):

#0 -[NibLoadingWindow awakeFromNib]
#1 0x9081d348 in -[NSSet makeObjectsPerformSelector:] ()
#3 0x930acf98 in -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] ()
#5 0x93123c70 in -[NSMenuItem keyEquivalentModifierMask] ()
#6 0x930e9e58 in +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] ()
#7 0x93149098 in +[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:] ()
#8 0x93148e58 in +[NSBundle(NSNibLoading) loadNibNamed:owner:] ()

-jim


P.S. Sometimes reading cocoa-dev is bad for your understanding of cocoa.
_______________________________________________
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.

  • Prev by Date: Re: Yap?
  • Previous by thread: Re: Strange problem showing a window
  • Next by thread: noCacheMask not working on iDisk?
  • Index(es):
    • Date
    • Thread