• 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: Outlets Not Connected In awakeFromNib
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Outlets Not Connected In awakeFromNib


  • Subject: Re: Outlets Not Connected In awakeFromNib
  • From: Matt Neuburg <email@hidden>
  • Date: Sat, 05 Mar 2011 11:00:56 -0800

On Fri, 04 Mar 2011 10:21:38 +0100, Andreas Grosam <email@hidden> said:
>All,
>
>thank you for your replies. It made me re-read the Resource Programming Guide. And it works exactly as it is described (except that the description for -awakeFromNib in the Reference could be more accurate). Though, I have mixed feelings about how it works.
>
>Unfortunately, due to the problem described previously, -awakeFromNib does not seem to be always appropriate for its intended use as described in the reference. There are also subtle differences between iOS and Mac OS.
>
>On iOS, when using -viewDidLoad, we need to consider that it can possibly be called more than once in the life cycle for a controller, and may be created from within a nib or programmatically. This often requires extra care in this and possibly related methods, e.g. -viewDidUnload. So, unfortunately, there is no easier way.

I'm not grasping where there can be any source of confusion here. awakeFromNib is very simple: it is sent to an object after that object is instantiated from a nib. That's straightforward and dependable and clear - provided you know what a nib is, of course. The only "subtle difference" between Mac OS X and iOS in this regard is that in iOS you are enjoined to call super in your implementation. (There are some memory management differences for objects instantiation from nibs between Mac OS X and iOS, but that's a different matter.)

What you say about viewDidLoad is perfectly true, but should not be an issue provided you do in viewDidLoad only things that are suitable for viewDidLoad (i.e. things that can do no harm if done more than once).

m.

--
matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
Programming iOS 4!
http://www.apeth.net/matt/default.html#iosbook_______________________________________________

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: Outlets Not Connected In awakeFromNib
      • From: Matt Neuburg <email@hidden>
    • Re: Outlets Not Connected In awakeFromNib
      • From: Carlos Eduardo Mello <email@hidden>
  • Prev by Date: Re: animating addSubview with iOS4
  • Next by Date: Re: Accepting current edited text field contents
  • Previous by thread: Re: Outlets Not Connected In awakeFromNib
  • Next by thread: Re: Outlets Not Connected In awakeFromNib
  • Index(es):
    • Date
    • Thread