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 选择器。

适用于