Re: Is cascading Nib Loading from -awakeFromNib permissible?
Re: Is cascading Nib Loading from -awakeFromNib permissible?
- Subject: Re: Is cascading Nib Loading from -awakeFromNib permissible?
- From: Dave Keck <email@hidden>
- Date: Wed, 11 Mar 2009 12:37:36 -1000
Hello,
It looks like this is your answer:
http://lists.apple.com/archives/cocoa-dev/2008/Apr/msg02276.html
It sounds like the object is the file's owner of the nibs that you're
loading using loadNibNamed:. Is this correct?
Also check out:
http://www.google.com/search?client=safari&rls=en-us&q=awakefromnib+called+twice&ie=UTF-8&oe=UTF-8
David
On Wed, Mar 11, 2009 at 12:19 PM, Stuart Malin <email@hidden> wrote:
> 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
>
_______________________________________________
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