Function 関数

sel_registerName(_:)

Registers a method with the Objective-C runtime system, maps the method name to a selector, and returns the selector value. あるメソッドをObjective-C runtimeシステムに登録して、そのメソッド名をあるセレクタにマップして、そしてそのセレクタ値を返します。

Declaration 宣言

func sel_registerName(_ str: UnsafePointer<CChar>) -> Selector

Parameters パラメータ

str

A pointer to a C string. Pass the name of the method you wish to register. あるC文字列へのポインタ。あなたが登録したいメソッドの名前を渡してください。

Return Value 戻り値

A pointer of type SEL specifying the selector for the named method.

Discussion 解説

You must register a method name with the Objective-C runtime system to obtain the method’s selector before you can add the method to a class definition. If the method name has already been registered, this function simply returns the selector. あなたは、メソッド名をObjective-C runtimeシステムに登録することで、そのメソッドのもつセレクタを、あなたがそのメソッドをクラス定義に追加する前に入手しなければなりません。メソッド名が既に登録されているならば、この関数は単にそのセレクタを返します。

See Also 参照

Working with Selectors セレクタを扱う