Re: Category loading (or absence thereof)
Re: Category loading (or absence thereof)
- Subject: Re: Category loading (or absence thereof)
- From: Sherm Pendley <email@hidden>
- Date: Sun, 15 Jun 2003 17:00:16 -0400
On Sunday, June 15, 2003, at 06:13 AM, Drew McCormack wrote:
I have a category full of methods that are not directly called from the
code. To call them, the runtime is queried, and they are called
'indirectly' with the information retrieved from the runtime.
Not having seen your code, here's a guess:
How are you querying the runtime - are you using getClass() to get the
class definition, and then reading through the methodLists structure? If
that's what you're doing, you should be aware that the pointer you get
is to the first element in an array of pointers to objc_method_list
structures. I'm not certain what sort of registration code is generated
by the compiler, but I'm willing to bet that it generates a
objc_method_list structure for each @implementation section it finds,
calling class_addMethods for each. I'm also willing to bet that this
results in more than one objc_method_list structure being in the
methodLists array.
If the above is what you're doing - getClass() and scanning
methodLists - have you tried using class_getInstanceMethod() and
class_getClassMethod() instead?
sherm--
UNIX: Where /sbin/init is Job 1.
_______________________________________________
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.