Re: awakeFromNib multiple objects - all connected?
Re: awakeFromNib multiple objects - all connected?
- Subject: Re: awakeFromNib multiple objects - all connected?
- From: Trygve Inda <email@hidden>
- Date: Fri, 04 Jul 2014 20:56:47 -0700
- Thread-topic: awakeFromNib multiple objects - all connected?
>
> On Jul 4, 2014, at 8:18 PM, Trygve Inda <email@hidden> wrote:
>
>> When an object in a nib receives awakeFromNib are all the outlets throughout
>> the entire nib hooked up, or only those outlets in the object that is
>> receiving awakeFromNib?
>
> All the outlets are hooked up. But not all the other objects in the nib have
> run their -awakeFromNib methods yet, so you have to be cautious about calling
> into other objects in the nib during your -awakeFromNib implementation.
>
> —Jens
That's fine. My situation is I have a subclass of NSWindowController and
several custom objects:
Owner (MyWindowController)
ControllerA
ControllerB
ControllerC
These are all in the nib and I call init in such a way that Owner is passed
a reference which it stores. When ControllerA gets an awakeFromNib it needs
to call methods in ControllerB and ControllerC that require all the outlets
to be hooked up.
I need to ensure ControllerA runs first so I do this by having an
awakeFromNib in ControllerA, but not in B or C. So that when ControllerA
gets awakeFromNib, it can manage things.
As long as A can call into B & C and know that B & C have their outlets
hooked up, that's fine.
_______________________________________________
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