Re: Copying an NSView?
Re: Copying an NSView?
- Subject: Re: Copying an NSView?
- From: Tom Dale <email@hidden>
- Date: Sat, 26 Jan 2002 11:56:16 -0800
Thanks for the help. I separated the NSView from the MainMenu nib and I
have it in a separate nib.
Now my problem is accessing the class.
I used [NSBundle loadNibNamed:@"nibName" owner:self ]; but after that
I'm not sure how to access the classes in it. Having looked through the
documentation and the examples I haven't found an answer. NSBundle's
classNamed: method looked promising, but it also didn't work. I am now
very confused as to how I can access the elements that are created when
loading a nib file.
Thanks for any help.
On Friday, January 25, 2002, at 04:01 PM, Ondra Cada wrote:
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
_______________________________________________
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.
Tom Dale
Mail: email@hidden
AIM: Ch8 Tom
ICQ: 34276177