Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -51,10 +51,18 @@ /** * \return The name of the class as a C string */ + (const char*)name; +/** + * \param selector The selector which should be checked for respondance + * + * \return A boolean whether instances of the class respond to the specified + * selector + */ ++ (BOOL)instancesRespondToSelector: (SEL)selector; + /** * \param protocol The protocol which should be checked for conformance * * \return A boolean whether the class conforms to the specified protocol */ Index: src/OFObject.m ================================================================== --- src/OFObject.m +++ src/OFObject.m @@ -94,10 +94,19 @@ return class_get_class_name(self); #else return class_getName(self); #endif } + ++ (BOOL)instancesRespondToSelector: (SEL)selector +{ +#ifdef __objc_INCLUDE_GNU + return class_get_instance_method(self, selector) != METHOD_NULL; +#else + return class_respondsToSelector(self, selector); +#endif +} + (BOOL)conformsToProtocol: (Protocol*)protocol { #ifdef __objc_INCLUDE_GNU Class c;