methodForSelector: should return the implementation, not the method object (per Cocoa docs).

This commit is contained in:
Ross Boucher
2009-04-09 15:07:19 -07:00
parent 213c70e00d
commit f2ced978c9
+6 -6
View File
@@ -226,23 +226,23 @@ CPLog(@"Got some class: %@", inst);</pre>
// 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);
}
/*!