Runtime.ConnectMethod 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
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 選取器。