Re: Using NSView as a template
Re: Using NSView as a template
- Subject: Re: Using NSView as a template
- From: Allan Odgaard <email@hidden>
- Date: Mon, 8 Mar 2004 23:56:56 +0100
On 8. Mar 2004, at 23:10, Matt Ball wrote:
Didn't work. I think what is happening is that NSArchiver is
disregarding the action that is set for the button. If i setAction
before I NSArchive, it disregards it. If I set it after, it affects
the template only, and is disregarded next time I duplicate the
template.
I think it disregards the *target*, as I wrote in another letter,
because the target is an object pointer, when you archive the view this
"connection" will break (unless the target was also archived).
Is there any other way of using an NSView as a template that might be
better suited?
Indeed! You create the template as its own Nib file and load the nib
for each copy you need -- you can then connect the target to File's
Owner and provide the object which implement the laodBookmarks: as
owner, when you load/instantiate the Nib.
You can either use the loadNibNamed:owner: class method (documented
among the AppKit additions to NSBundle) or use the "new" NSNib class
(which doesn't load from disk each time, but if the Nib is simple and
the instantiation is grouped, then I would think that the disk cache is
enough).
_______________________________________________
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.