Re: Creating a subclass of an *unknown* object
Re: Creating a subclass of an *unknown* object
- Subject: Re: Creating a subclass of an *unknown* object
- From: Damien Bobillot <email@hidden>
- Date: Wed, 15 Jun 2005 13:19:42 +0200
Le 14 juin 05 à 22:51, Ofri Wolfus a écrit :
I'm creating a plugin for an application in which is not mine but
is open source so i have the code for it.
What i'm trying to do is to subclass an object that's within the
app and when my plugin is loaded, to pose it as the original
object. The problem is that i'm getting an undefined symbol error
when when compiling my plugin.
I *could* include the header and implementation files of the
original object within my plugin, but this means that if in a
future version this object will change and my plugin will be
loaded, both versions of the object will be loaded and this is not
a good thing.
Just #import the header file of the original object. When the host
application load the plugin, your code will be dynamically linked to
the application code, so the Objective-C runtime will be able to find
the implementation of the base object your plugin inherit from.
You must not include the orginal implementation in your plugin. If
you do so, at runtime there will be 2 definitions of the same object
(both implementations will be identical, but for the Objective-C
runtime, it's two independant implementations).
--
Damien Bobillot
_______________________________________________
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