Is cascading Nib Loading from -awakeFromNib permissible?
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