Re: Multiple invocations of awakeFromNib on a single instance?
Re: Multiple invocations of awakeFromNib on a single instance?
- Subject: Re: Multiple invocations of awakeFromNib on a single instance?
- From: "Erik M. Buck" <email@hidden>
- Date: Thu, 24 Jan 2002 17:46:53 -0600
-awakeFromNib IS called for the nib's owner and it is not a bug. It is also
documented. Here is one place it is documented.
http://developer.apple.com/techpubs/macosx/Cocoa/TasksAndConcepts/Programmin
gTopics/LoadingResources/index.html#//apple_ref/10000051i
<Quote>
Typically, awakeFromNib is implemented for classes whose instances are used
as the owners of a loaded nib file (shown as "File's Owner" in Interface
Builder). Such a class has the express purpose of connecting the loaded
objects with objects in the application, and can thereafter be disposed of,
or remain in the capacity of a controller or coordinator for the loaded
objects. For example, suppose that a nib file contains two custom views that
must be positioned relative to each other at run time. Trying to position
them when either one of the views is initialized (in initWithCoder: or a
setVariable: method) might fail, since the other views might not be
unarchived and initialized yet. However, it can be done in the nib file
owner's awakeFromNib method (firstView and secondView are outlets of the
file's owner):
<End Quote>
----- Original Message -----