Re: Copying an NSView?
Re: Copying an NSView?
- Subject: Re: Copying an NSView?
- From: Ondra Cada <email@hidden>
- Date: Sat, 26 Jan 2002 01:01:38 +0100
tomdale,
>
>>>>> email@hidden (t) wrote at Fri, 25 Jan 2002 15:49:05 -0800:
t> What I want to do is
t> create a new instance of my custom NSView and set that copy to the view
t> of the newly created NSTabViewItem. The problem is that NSView doesn't
t> conform to NSCopying, so I'm at a bit of a loss as to what to do.
Well, this should be in FAQ, I guess -- particularly since for a newbie the
correct answer is not intuitive the slightlest bit.
Well, it's surprisingly simple: store the view(s) you need into a NIB, and
load this NIB whenever you want a copy of the view. That's all, with a BIG
added benefit of you being able to set up those views in InterfaceBuilder
instead of the programmatical legwork.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc