Re: Getting a list of all classes, etc...
Re: Getting a list of all classes, etc...
- Subject: Re: Getting a list of all classes, etc...
- From: Chris Suter <email@hidden>
- Date: Thu, 27 Mar 2008 17:59:40 +1100
On 27/03/2008, at 4:59 PM, Graham Cox wrote:
This worked well (after a little tweaking!) thanks - got the whole
caboodle running now. I note that NSObject's superclass is NULL, so
I had to switch the order of the while() test in order to correctly
detect plain NSObjects (admittedly this will probably never be
needed in practice).
Here's my implementation (including objective C 2.0 variant), for
anyone's further use:
[snip]
You could probably implement classIsSubclassOfClass as:
BOOL classIsSubclassOfClass (const Class aClass, const Class subclass)
{
return class_getClassMethod (aClass, @selector (isSubclassOfClass:))
? [aClass isSubclassOfClass:subclass] : NO;
}
- Chris
_______________________________________________
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