ftp.nice.ch/peanuts/GeneralData/Documents/openstep/OpenStepSpec_rtf.tar.gz#/OpenStepSpec_rtf/ApplicationKit/Protocols/NSNibAwaking.rtf

This is NSNibAwaking.rtf in view mode; [Download] [Up]

paperh18648 margl-907 margr0 margt0 margb0 fi0 ri0 ql sb0 f1 fs24 Copyright f3 'e3f1 1994 by NeXT Computer, Inc.  All Rights Reserved.

s12 li100 fi0 ri1007 ql f0 b fs36 fs100 
fs36 NSNibAwaking
s29 fs28 (informal protocol)
pard s7 li2872 fi-2771 ri1007 ql tx2872 f1 b0 fs28 fs48 
fs28 f0 b fs24 Category Of:tab b0 fs28 f1 NSObject
fs20 
fs28 s17 f0 b fs24 Declared In:tab b0 fs28 f1 AppKit/NSNibLoading.h
fs20 
fs28 pard s45 li100 fi0 ri1007 ql f0 b fs28 fs20 
fs28 Protocol Description
fs14 
fs28 pard s3 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 b0 fs2 
fs28 This informal protocol consists of a single method, b awakeFromNibb0 . It'27s implemented to receive a notification message that'27s sent after objects have been loaded from an Interface Builder archive.
fs16 
fs28 When b loadNibFile:owner:b0  or a related method loads an Interface Builder archive into an application, each custom object from the archive is first initialized with an b initb0  message (b initFrame:b0  if the object is a kind of View). Outlets are initialized via any b setb0 i Variableb i0 :b0  methods that are available (where i variablei0  is the name of an instance variable). (These methods are optional; the Objective C run time system automatically initializes outlets.) Finally, after all the objects are fully initialized, they each receive an b awakeFromNibb0  message.
fs16 
fs28 The order in which objects are loaded from the archive is not guaranteed. Therefore, it's possible for a b setb0 i Variableb i0 :b0  message to be sent to an object before its companion objects have been unarchived. For this reason, b setb0 i Variableb i0 :b0  methods should not send messages to other objects in the archive. However, messages to other objects can safely be sent from within b awakeFromNibb0 'd0by this point it's assured that all the objects are unarchived and fully initialized. 
fs16 
fs28 Typically, b awakeFromNibb0  is implemented for only one object in the archive, the controlling or 'aaowner'ba object for the other objects that are archived with it. For example, suppose that a nib file contained two 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 a b setb0 i Variableb i0 :b0  method) might fail, since the other View might not be unarchived and initialized yet. However, it can be done in an b awakeFromNibb0  method:
fs16 
fs28 pard s14 li1231 fi0 ri1007 ql f2 fs20 - awakeFromNib
{
    NXRect viewFrame;

    [firstView getFrame:&viewFrame];
    [secondView moveTo:viewFrame.origin.x + someVariable
                    :viewFrame.origin.y];
    return self;
}
pard s3 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 fs28 fs16 
fs28 There's no default b awakeFromNibb0  method; an b awakeFromNibb0  message is only sent if an object implements it. The Application Kit declares a prototype for this method, but doesn't implement it.
fs16 
fs28 pard s45 li100 fi0 ri1007 ql f0 b fs24 
fs28 Notification of Loading
fs14 
fs28 pard s20 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (void)b awakeFromNibb0 i tab i0 Implemented to prepare an object for service after it has been loaded from an Interface Builder archive'd0a so-called 'aanib file'ba. An b awakeFromNibb0  message is sent to each object loaded from the archive, but only if it can respond to the message, and only after all the objects in the archive have been loaded and initialized. When an object receives an b awakeFromNibb0  message, it'27s already guaranteed to have all its outlet instance variables set. There'27s no default b awakeFromNibb0  method. 
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.