Re: find all subclasses?
Re: find all subclasses?
- Subject: Re: find all subclasses?
- From: Glenn Andreas <email@hidden>
- Date: Wed, 22 Sep 2004 21:35:05 -0500
Hi all,
I thought I've solved this ages ago, but seems I did not :)
Is there a decent way for a class code to find all its subclasses?
Unless I have overlooked something, I cannot use
NSBundleDidLoadNotification (for even if I add observer in +load it
is too late, it does not get "its own" notification), nor
objc_getClassList helps (for it shows registered classes only,
and--at least in my tests--that boils down to classes which already
have received at least one message).
Are you testing that with Zerolink enabled? If it is, classes aren't
always loaded until it recieves a message (like you're seeing). I
use objc_getClassList in gandbug and haven't noticed this problem
(and I know it shows classes I've never used in the application). It
may though just be a matter of not noticing...
Thanks for any advice,
If you _really_ need it, you can find all open dyld images, walk
through the sections of those dyld entities, find the appropriate
section (objc_classes or something like that? It's buried deep in
the runtime architecture documents) and grab the class information
from there.
--
Glenn Andreas email@hidden
<http://www.gandreas.com/> oh my!
Mad, Bad, and Dangerous to Know
_______________________________________________
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