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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to