• 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
Is cascading Nib Loading from -awakeFromNib permissible?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Is cascading Nib Loading from -awakeFromNib permissible?


  • Subject: Is cascading Nib Loading from -awakeFromNib permissible?
  • From: Stuart Malin <email@hidden>
  • Date: Wed, 11 Mar 2009 12:19:30 -1000

In my MainMenu Nib I have a controller object. The code for that controller object has an -awakeFromNib method. That method invokes NSBundle's -loadNibNamed: method to load yet another Nib. Doing this leads to repeating invocations of the -awakeFromNib method of the initial controller (it is the same object, not new ones).

Now, that leads me to think: just add an ivar flag that is set before invoking -loadNibNamed: so that a subsequent invocation of the controller's -awakeFromNib can ignore the secondary call. So I do this... and everything *appears* to work. But... I am concerned this may not be safe. Perhaps Nib loading is not re-entrant, even in the same thread. Question: Is what I am doing safe, dangerous, or does that not matter and my architecture/approach is not a good practice?
_______________________________________________


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


  • Follow-Ups:
    • Re: Is cascading Nib Loading from -awakeFromNib permissible?
      • From: Dave Keck <email@hidden>
  • Prev by Date: Re: subclassing UIScrollView
  • Next by Date: Re: Is cascading Nib Loading from -awakeFromNib permissible?
  • Previous by thread: Re: NSMenuItem Binding Problem
  • Next by thread: Re: Is cascading Nib Loading from -awakeFromNib permissible?
  • Index(es):
    • Date
    • Thread