Re: Outlets Not Connected In awakeFromNib
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