• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Creating a subclass of an *unknown* object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating a subclass of an *unknown* object


  • Subject: Re: Creating a subclass of an *unknown* object
  • From: Marco Scheurer <email@hidden>
  • Date: Wed, 15 Jun 2005 16:42:17 +0200


On Jun 14, 2005, at 10:51 PM, Ofri Wolfus wrote:

Hi all,
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.
What should I do?

In order to subclass, you need to include the superclass header. I'm affraid there's no easy way around this. One could attempt some kind of runtime wizardry involving dynamic class creation, I don't know how feasible it is in your case.


Are you sure that your poseAsClass message will be sent soon enough to succeed? It must happens before instances of the original class are created.

Marco Scheurer
Sen:te, Lausanne, Switzerland   http://www.sente.ch

_______________________________________________
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


References: 
 >Creating a subclass of an *unknown* object (From: Ofri Wolfus <email@hidden>)

  • Prev by Date: Re: Creating a subclass of an *unknown* object
  • Next by Date: Re: Creating a subclass of an *unknown* object
  • Previous by thread: Re: Creating a subclass of an *unknown* object
  • Next by thread: Re: Creating a subclass of an *unknown* object
  • Index(es):
    • Date
    • Thread