Instance Method インスタンスメソッド

method(for:)

Locates and returns the address of the receiver’s implementation of a method so it can be called as a function. あるメソッドのこのレシーバの持つ実装の所在(アドレス)を突き止めて返します、それでそれは関数として呼び出し可能です。

Declaration 宣言

func method(for aSelector: Selector!) -> IMP!

Parameters パラメータ

aSelector

A Selector that identifies the method for which to return the implementation address. The selector must be a valid and non-NULL. If in doubt, use the responds(to:) method to check before passing the selector to method(for:).

Return Value 戻り値

The address of the receiver’s implementation of the aSelector.

Discussion 解説

If the receiver is an instance, aSelector should refer to an instance method; if the receiver is a class, it should refer to a class method.

See Also 参照

Obtaining Information About Methods メソッドについての情報の取得