Skip navigation.
 
mlRe: IB Palettes?
FROM : Jonathan Hess
DATE : Thu Nov 22 22:16:02 2007

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_removed>)
>
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>

Related mailsAuthorDate
mlIB Palettes? Rick Mann Nov 22, 20:25
mlRe: IB Palettes? Jonathan Hess Nov 22, 22:16
mlRe: IB Palettes? Rick Mann Nov 22, 22:32
mlRe: IB Palettes? Ricky Sharp Nov 23, 04:04
mlRe: IB Palettes? Jon Hess Nov 23, 08:05