Re: reestablishing IBOutlets from initWithCoder ?
Re: reestablishing IBOutlets from initWithCoder ?
- Subject: Re: reestablishing IBOutlets from initWithCoder ?
- From: Vince DeMarco <email@hidden>
- Date: Thu, 24 Jan 2002 14:38:51 -0800
On Thursday, January 24, 2002, at 01:29 PM, Robert Miller wrote:
Hello,
This is perhaps a rather unique scenario (then again maybe not but I
haven't been able to figure it out). I have a custom view subclass of
NSView that has IBOutlets instance variables defined in it for things
like buttons and popup menus, and other views. When I archive /
unarchive the custom view everything gets restored properly except the
IBOutlet instance values. Since archiving an NSView handles the
archiving of its subviews some of which are my IBOutlet object
references I don't want to rearchive my IBOutlet instances. Is there
some clever way of reestablishing the IBOutlet connections when
unarchiving ? I've tried using tag values for some of the subviews and
that works by looking for the tag using 'viewWithTag' inside of my
initWithCoder override but that solution isn't the greatest since not
all cocoa objects provide a tag value in their inspector window. Any
ideas on how to reconnect IBOutlets from an unarchive operation ?
I don't understand what you are after. Interface Builder archives the
connections separately from the objects in the nib file.
For example NSButton "knows" how to archive references to its target and
action, but
IB doesn't let NSButton do the archiving, instead its done outside of the
object.
vince