Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -80,10 +80,15 @@ * \return A boolean whether the class class is a subclass of the specified * class */ + (BOOL)isSubclassOfClass: (Class)class_; +/** + * \return The superclass of the class + */ ++ (Class)superclass; + /** * Checks whether instances of the class respond to a given selector. * * \param selector The selector which should be checked for respondance * \return A boolean whether instances of the class respond to the specified Index: src/OFObject.m ================================================================== --- src/OFObject.m +++ src/OFObject.m @@ -160,10 +160,19 @@ if (iter == class) return YES; return NO; } + ++ (Class)superclass +{ +#ifdef OF_APPLE_RUNTIME + return class_getSuperclass(self); +#else + return class_get_super_class(self); +#endif +} + (BOOL)instancesRespondToSelector: (SEL)selector { #ifdef OF_APPLE_RUNTIME return class_respondsToSelector(self, selector);