Re: Outlets Not Connected In awakeFromNib
Re: Outlets Not Connected In awakeFromNib
- Subject: Re: Outlets Not Connected In awakeFromNib
- From: Kyle Sluder <email@hidden>
- Date: Thu, 03 Mar 2011 08:57:00 -0800
On Thu, Mar 3, 2011 at 4:37 AM, Andreas Grosam <email@hidden> wrote:
> At the time awakeFromNib is sent to the root view controller, the root view controller's outlets whose target exists in the main nib are connected. However, none of the outlets whose target objects exist in its corresponding nib "MyRootViewController nib" are connected.
>
> There is nothing in the docs mentioning this case.
-awakeFromNib is sent to every object in the nib after all the
connections defined in the nib have been established. Since cross-nib
connections are not allowed, the documentation has no need to mention
your scenario.
Perhaps the documentation should be rephrased to say "all connections
defined in the nib are guaranteed to have been reestablished" rather
than guaranteeing that all outlets have been connected, which is
inaccurate.
On Thu, Mar 3, 2011 at 4:27 AM, Andreas Grosam <email@hidden> wrote:
> When -awakeFromNib is sent to the root view controller, the outlet 'testView' is not connected. The message is sent during *loading the main nib*. The root view controller does not receive another -awakeFromNib message.
>From the Resource Programming Guide:
"In iOS, this message [-awakeFromNib] is sent only to the interface
objects that were instantiated by the nib-loading code. It is not sent
to File’s Owner, First Responder, or any other proxy objects."
So the answer to your problem is use the UIViewController methods to
find out when your RootViewController has loaded its view.
--Kyle Sluder
_______________________________________________
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