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

Re: Getting all subclasses


  • Subject: Re: Getting all subclasses
  • From: Omar Qazi <email@hidden>
  • Date: Tue, 17 Jun 2008 22:43:54 -0700

On Jun 17, 2008, at 10:19 PM, Laurent Cerveau wrote:

Hi

Is there a way to get all subclases of a class. I have a class that I would call abstract (although I did not find any real way to declare some methods as virtual) and would like to get a list of all "real" subclass implementations.

Thanks

laurent

If you have a bunch of classes that you want to check you can call [SomeClass isSubclassOf:anotherClass].


If you wrote the class yourself, what I would do is override the + initialize method to add the class to some kind of global array that you can access later. The runtime sends initialize to each class in a program exactly one time just before the class is sent its first message from within the program. So this will only work for each class that is actually used within the application.

Omar Qazi
Hello, Galaxy!
1.310.294.1593

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Getting all subclasses (From: Laurent Cerveau <email@hidden>)

  • Prev by Date: Getting all subclasses
  • Next by Date: capture modifier key events
  • Previous by thread: Getting all subclasses
  • Next by thread: Re: Getting all subclasses
  • Index(es):
    • Date
    • Thread