Re: IB Palettes?
Re: IB Palettes?
- Subject: Re: IB Palettes?
- From: Jonathan Hess <email@hidden>
- Date: Thu, 22 Nov 2007 13:16:02 -0800
On Nov 22, 2007, at 11:25 AM, Rick Mann wrote:
I'm reading the NSView docs, and I got to the section on using IB.
It says, "If you have not created an Interface Builder palette for
your custom view, there are two techniques you can use to create
instances of your subclass within Interface Builder."
Hey Rick -
In Interface Builder you can specify that any instance can be of a
different more derived type at runtime. To do this use the identity
inspector (command + 6) and use the custom class combo box to type in
a new class name. At runtime, an instance of that class will be
instantiated in place of the selected object.
So, if you subclassed NSView, drag an NSCustomView to your document.
If you subclassed something more specific like an NSButton, drag an
NSButton to your document. Once you've done that select the instance
and use the identity inspector to change the class to your custom
subclass. When you load your nib at runtime an instance of your custom
class will be instantiated instead of the button.
Jon Hess
Where do I learn how to do this?
TIA,
Rick
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden