Re: reestablishing IBOutlets from initWithCoder ?
Re: reestablishing IBOutlets from initWithCoder ?
- Subject: Re: reestablishing IBOutlets from initWithCoder ?
- From: Christophe Dore <email@hidden>
- Date: Mon, 28 Jan 2002 11:58:30 +0100
Have you written the NSCoder procotol in your custom view yourself ?
did you mention there to save also the IBOutlets ?
Robert Miller wrote:
I have an application that allows archiving of a view for placement into a
pasteboard. The view is loaded from a nib file and some of the views
subviews, (popup, button, etc.) have IBOutlets in the view that are connected
in the nib. The problem is when the view (and its subviews) are archived to
the pasteboard and then unarchived for pasting into some other view, the
IBOutlet connections that were connected from the view to its subviews are
lost. The unarchiving does not appear to reestablish any IBOutlet
connections.
Vince DeMarco wrote:
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
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.