Re: awakeFromNib multiple objects - all connected?
Re: awakeFromNib multiple objects - all connected?
- Subject: Re: awakeFromNib multiple objects - all connected?
- From: Roland King <email@hidden>
- Date: Sun, 06 Jul 2014 14:54:01 +0800
>
> The resource programming guide explicitly describes the sending of
> -awakeFromNib as occurring after all outlets have been set up:
>
> <https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/CocoaNibs.html#//apple_ref/doc/uid/10000051i-CH4-SW18>
>
[ oops didn't reply to the list ]
.. which is one of the things always bothered me when you load UIViewControllers + views from NIBs. In that NIB you usually have a UIViewController as file's owner, a view which is its view which has a load of subviews, plus some other top-level objects. Often some of the view's subviews are IBOutlets of the UIViewController, eg buttons you want to enable and disable etc.
After awakeFromNib all the outlets are connected except for those to subviews of the UIViewController's view, they remain nil until after viewDidLoad. Other top-level object outlets are connected, but not the view nor its subviews. I always felt that broke the awakeFromNib contract; the objects are in the NIB, the outlets are in the NIB, surely they should be connected at awakeFromNib.
_______________________________________________
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