• 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: find all subclasses?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: find all subclasses?
      • From: Ondra Cada <email@hidden>
References: 
 >find all subclasses? (From: Ondra Cada <email@hidden>)

  • Prev by Date: Safari-like View Change
  • Next by Date: Re: find all subclasses?
  • Previous by thread: find all subclasses?
  • Next by thread: Re: find all subclasses?
  • Index(es):
    • Date
    • Thread