Function 関数

class_copyMethodList

Describes the instance methods implemented by a class. あるクラスによって実装されたインスタンスメソッドを記述します。

Declaration 宣言

Method  _Nonnull * class_copyMethodList(Class cls, unsigned int *outCount);

Parameters パラメータ

cls

The class you want to inspect. あなたが調査したいクラス。

outCount

On return, contains the length of the returned array. 戻りでは、返された配列の長さを含みます。 If outCount is NULL, the length is not returned.

Return Value 戻り値

An array of pointers of type Method describing the instance methods implemented by the class—any instance methods implemented by superclasses are not included. The array contains *outCount pointers followed by a NULL terminator. You must free the array with free().

If cls implements no instance methods, or cls is Nil, returns NULL and *outCount is 0.

Discussion 解説

To get the class methods of a class, use class_copyMethodList(object_getClass(cls), &count).

To get the implementations of methods that may be implemented by superclasses, use class_getInstanceMethod or class_getClassMethod.

See Also 参照

Working with Classes クラスを扱う