• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: awakeFromNib multiple objects - all connected?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: awakeFromNib multiple objects - all connected?
      • From: Uli Kusterer <email@hidden>
References: 
 >Re: awakeFromNib multiple objects - all connected? (From: Trygve Inda <email@hidden>)
 >Re: awakeFromNib multiple objects - all connected? (From: Graham Cox <email@hidden>)
 >Re: awakeFromNib multiple objects - all connected? (From: Rob Petrovec <email@hidden>)
 >Re: awakeFromNib multiple objects - all connected? (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: awakeFromNib multiple objects - all connected?
  • Next by Date: Looking for OS X 10.9 and above contract developer with immediate availability
  • Previous by thread: Re: awakeFromNib multiple objects - all connected?
  • Next by thread: Re: awakeFromNib multiple objects - all connected?
  • Index(es):
    • Date
    • Thread