Re: IB Palettes, custom classes and the need for Frameworks
Re: IB Palettes, custom classes and the need for Frameworks
- Subject: Re: IB Palettes, custom classes and the need for Frameworks
- From: Gregory John Casamento <email@hidden>
- Date: Wed, 12 Jan 2005 19:05:27 -0800 (PST)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
Tim,
--- Tim Lucas <email@hidden> wrote:
> I've made a custom IB Palette that contains a custom NSView subclass,
> say MySpecialView.
>
> The palette works perfect using test mode in IB, but then if I save the
> NIB and go back to xcode and build+run then I get the 'MySpecialView
> class not found' error. To fix this I've created a framework, copied it
> to my frameworks directory and added it to the xcode project.
It works fine in test mode since you defined the class in the palette. When
the palette bundle is loaded, the class is dynamically linked into
InterfaceBuilder.
> So, for users of my palette they need to add the palette in IB
> preferences, copy the framework to their frameworks directory and add
> the framework to their xcode project.
Yes.
> Its a bugger to add it to the xcode project when they're not even using
> it in their code.
But they are using it in the nib file. A nib file is just a set of encoded
data which is used to instantiate the objects with the appropriate connections
(i,e. the ones made by the user in IB). In order to do this you *must* have
the classes you are unarchiving from the nib file linked into the application
for you to be able to use it.
> Having to remember to add a framework to your project everytime you use
> a certain IB palette just seems wrong.
It's not wrong, for the reason cited above. :)
> Is there a way to make this easier for the developers, or is this the
> only way?
It is the only way. Also, one suggestion, you should be linking your palette
with the same framework you created.
> - tim lucas
>
> http://www.toolmantim.com
FYI, Gorm (IB for GNUstep) works the same way as well and so does IB for
OPENSTEP/NeXTSTEP (the predecessors of Mac OS X/Cocoa) for all of the reasons
explained above.
Later, GJC
=====
Gregory John Casamento
-- CEO/President Open Logic Corp. (A Maryland Corporation)
#### Maintainer of Gorm for GNUstep.
_______________________________________________
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