From fb97e23e5030fb41a5d08f72c5e71840b78f74b8 Mon Sep 17 00:00:00 2001 From: rfm Date: Wed, 24 Feb 2010 10:21:25 +0000 Subject: [PATCH] fix class_respondsToSelector() --- runtime.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/runtime.c b/runtime.c index c05c5a2..b2dbeaf 100644 --- a/runtime.c +++ b/runtime.c @@ -435,9 +435,13 @@ IMP class_replaceMethod(Class cls, SEL name, IMP imp, const char *types) } -BOOL class_respondsToSelector(Class cls, SEL sel) +BOOL +class_respondsToSelector(Class cls, SEL sel) { - return __objc_responds_to(cls, sel); + /* Warning the __objc_responds_to() function expects an id argument and + * dereferences the initial ivar (the 'isa' pointer) to fidn the class. + */ + return __objc_responds_to((Class)&cls, sel); } void class_setIvarLayout(Class cls, const char *layout)