共用方式為


Runtime.ConnectMethod 方法

定義

多載

ConnectMethod(MethodInfo, Selector)

這個呼叫可讓這個方法中的指定方法回應指定選取器上的訊息調用。

ConnectMethod(Type, MethodInfo, ExportAttribute)

這個呼叫可讓這個方法中的指定方法回應指定選取器上的訊息調用。

ConnectMethod(Type, MethodInfo, Selector)

這個呼叫可讓這個方法中的指定方法回應指定選取器上的訊息調用。

ConnectMethod(MethodInfo, Selector)

這個呼叫可讓這個方法中的指定方法回應指定選取器上的訊息調用。

public static void ConnectMethod (System.Reflection.MethodInfo method, ObjCRuntime.Selector selector);
static member ConnectMethod : System.Reflection.MethodInfo * ObjCRuntime.Selector -> unit

參數

method
MethodInfo

Objective-C 將訊息傳送至指定的選取器時所呼叫的方法。

selector
Selector

要連線的選取器。

備註

方法必須在 NSObject 衍生類別上宣告。

開發人員可以使用這個方法來動態重新設定類別上的哪些方法應該回應哪一個 Objective-C 選取器。

適用於

ConnectMethod(Type, MethodInfo, ExportAttribute)

這個呼叫可讓這個方法中的指定方法回應指定選取器上的訊息調用。

public static void ConnectMethod (Type type, System.Reflection.MethodInfo method, Foundation.ExportAttribute export);
static member ConnectMethod : Type * System.Reflection.MethodInfo * Foundation.ExportAttribute -> unit

參數

type
Type

連線到此類型的選取器。

method
MethodInfo

Objective-C 將訊息傳送至指定的選取器時所呼叫的方法。

export
ExportAttribute

匯出屬性,指定要連接的選取器。

備註

方法必須在 NSObject 衍生類別上宣告。

開發人員可以使用這個方法來動態重新設定類別上的哪些方法應該回應哪一個 Objective-C 選取器。

適用於

ConnectMethod(Type, MethodInfo, Selector)

這個呼叫可讓這個方法中的指定方法回應指定選取器上的訊息調用。

public static void ConnectMethod (Type type, System.Reflection.MethodInfo method, ObjCRuntime.Selector selector);
static member ConnectMethod : Type * System.Reflection.MethodInfo * ObjCRuntime.Selector -> unit

參數

type
Type

連線到此類型的選取器。

method
MethodInfo

Objective-C 將訊息傳送至指定的選取器時所呼叫的方法。

selector
Selector

要連線的選取器。

備註

方法必須在 NSObject 衍生類別上宣告。

開發人員可以使用這個方法來動態重新設定類別上的哪些方法應該回應哪一個 Objective-C 選取器。

適用於