From f2ced978c9df8d4ed0ad87488febdecaabd3e7ec Mon Sep 17 00:00:00 2001 From: Ross Boucher Date: Thu, 9 Apr 2009 15:07:19 -0700 Subject: [PATCH] methodForSelector: should return the implementation, not the method object (per Cocoa docs). --- Foundation/CPObject.j | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Foundation/CPObject.j b/Foundation/CPObject.j index 90f59227d..b222b8ebf 100644 --- a/Foundation/CPObject.j +++ b/Foundation/CPObject.j @@ -226,23 +226,23 @@ CPLog(@"Got some class: %@", inst); // Obtaining method information /*! - Returns the address of the receiver's method for the provided selector. + Returns the implementation of the receiver's method for the provided selector. @param aSelector the selector for the method to return - @return the address of the method's implementation + @return the method implementation ( a function ) */ - (IMP)methodForSelector:(SEL)aSelector { - return class_getInstanceMethod(isa, aSelector); + return class_getMethodImplementation(isa, aSelector); } /*! - Returns the address of the receiving class' method for the provided selector. + Returns the implementation of the receiving class' method for the provided selector. @param aSelector the selector for the class method to return - @return the address of the method's implementation + @return the method implementation ( a function ) */ + (IMP)instanceMethodForSelector:(SEL)aSelector { - return class_getInstanceMethod(self, aSelector); + return class_getMethodImplementation(self, aSelector); } /*!