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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to