Dave DeLong Dave DeLong - 1 year ago 76
Objective-C Question

Obtain list of class methods for an arbitrary class

How can I get the list of class methods for a particular Class? I've tried using the

function declared in
, but that's only giving me instance methods. I've also found a function that gives me a Method for a class method, but only if I have the selector to the method first (

Any ideas?



Answer Source

class_copyMethodList returns the instance methods of the passed class. The class methods are actually instance methods of the class's metaclass.

The solution to your problem is included right in the API Documentation for class_copyMethodList.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download