Re: Using an IB-built view multiple times
Re: Using an IB-built view multiple times
- Subject: Re: Using an IB-built view multiple times
- From: Michel Schinz <email@hidden>
- Date: Tue, 20 Sep 2005 18:27:45 +0200
Le 20 sept. 05 à 18:08, Christopher Drum a écrit :
It seems that this is possible if I create the entire template view
programatically, then instantiate one anytime I need it. However, I
was hoping there was some kind of procedure that would allow me to
build the template graphically, then clone out instances of that
view as needed. NSView doesn't seem to adhere to <NSCopying>
protocol. So, I'm getting myself a little lost here. Is it even
possible to subclass NSView to adhere to <NSCopying>?
In Interface Builder, you can drag a "Custom View" object in the
"Instances" pane. That will create a view, which will be shown in a
window. You can then set its contents in IB, as usual, and save the
NIB file. Then, in your code, you simply use the NSNib class to load
the file and instantiate it as many times as you want. Voilà...
Michel.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden