Re: Getting all subclasses
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