Re: Categories in plugins
Re: Categories in plugins
- Subject: Re: Categories in plugins
- From: Hiroshi Saito <email@hidden>
- Date: Sat, 2 Jul 2005 02:06:04 +0900
Hi Knud,
Year, it seems strange for me too. I know you can add methods to
class at runtime.
See this;
http://developer.apple.com/documentation/Cocoa/Reference/
ObjCRuntimeRef/ObjCRuntimeRef/chapter_1.2_section_6.html#//apple_ref/
doc/uid/TP40001418-//apple_ref/doc/uid/20001426-126286-TPXREF104
And categories are not different classes to which those categories
correspond...
--
Hiroshi
On 2005/06/30, at 21:38, Knud Möller wrote:
Hi all,
I already posted this on macosx-dev, but got no replies. Maybe
somebody here has an idea. I have a little problem with categories
and the visibility of methods defined therein:
- I have a shared framework that defines a class "Entry".
- I have an application A that does some stuff and creates some
instances of "Entry"
- I have a plugin P that gets loaded at runtime by A. P also
defines a category of "EntryXML" of "Entry"
Now, in the plugin I have the following code. "entries" here is an
NSArray of "Entry" objects that were instantiated in the application:
NSLog(@"fine...");
Entry *testEntry = [[Entry alloc] init];
NSLog([testEntry dumpAsXML]);
NSLog(@"still fine...");
NSEnumerator *enumerator = [entries objectEnumerator];
Entry *entry;
while (entry = [enumerator nextObject])
[xmlDump appendString: [entry dumpAsXML]];
The output of this is:
2005-06-28 18:15:53.194 MiniText[940] fine...
2005-06-28 18:15:53.194 MiniText[940] <entry date="28/06/2005,
18:15" title="New Entry" sort="2005-06-28-18-15"/>
2005-06-28 18:15:53.194 MiniText[940] still fine...
2005-06-28 18:15:53.194 MiniText[940] *** -[Entry dumpAsXML]:
selector not recognized
So, the Entry objects that were instantiated in the application
don't seem to know the "dumpAsXML" method, while the Entry object
defined just there in the plugin happily accepts it. Does anybody
have an idea what is going on here?
-------------------------------------------------
Knud Möller, MA
+353 - 91 - 512624
Digital Enterprise Research Institute
National University of Ireland, Galway
Institiúid Taighde na Fiontraíochta Digití
Ollscoil na hÉireann, Gaillimh
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40pob.org
This email sent to email@hidden
_______________________________________________
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