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 (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