Subclassing in plugins
Subclassing in plugins
- Subject: Subclassing in plugins
- From: Drew McCormack <email@hidden>
- Date: Fri, 25 Oct 2002 12:19:03 +0200
I would like to be able to write subclasses in a plugin, of a base
class in my app. I recently read an article on MacDevCenter by Mike
Beam which does just that: He has a filter class (IAFilter.h and
IAFilter.m) defined in both the main application, and the plugin, and
he subclasses it in the plugin.
I actually thought this would cause problems, because you end up with
two implementations of the class, even though they are the same. It
seems I was right. If I look at the console when I try this trick, I
get errors of this type for all classes that are implemented in both
the app and plugin:
Oct 25 11:45:01 Drew-McCormacks-Computer /Users/cormack/Cocoa
programs/Dynasity/build/Dynasity.app/Contents/MacOS/Dynasity: objc:
Both /Users/cormack/Cocoa
programs/Dynasity/build/Dynasity.app/Contents/MacOS/Dynasity and
/Users/cormack/Cocoa programs/Dynasity/build/XYZ
Reader.plugin/Contents/MacOS/XYZ Reader have implementations of class
Molecule.
Also my app crashes, and when I try to debug it, it exits with status
1, with no output, at the following line:
return [Molecule class];
The Molecule class is one of the classes duplicated in the main app and
the plugin. I thus conclude that including a class implementation in
both the main app and one or more plugins is illegal, and that someone
should tell Mike Beam. Is this conclusion correct?
More importantly for me, what is the easiest way to be able to subclass
a class in the main application from within a plugin?
I also would like to know just how to use a class from the main app
from within a plugin. I thought I only needed to include the header
file of the class in the plugin to achieve this, but then I get a link
error. And if I include the implementation file of the class too, well,
then I am back where I started.
Drew
========================================
Dr. Drew McCormack (Kmr. R153)
Afd. Theoretische Chemie
Faculteit Exacte Wetenschappen
Vrije Universiteit Amsterdam
De Boelelaan 1083
1081 HV Amsterdam
The Netherlands
Email email@hidden
Telephone +31 20 44 47623
Mobile +31 6 483 21307
Fax +31 20 44 47629
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.