Protocol 构造函数

定义

重载

Protocol(IntPtr)

为指定的 Objective-C 协议创建 Protocol 类的实例。

Protocol(String)

通过按名称查找协议来创建 Protocol 的实例。

Protocol(Type)

为指定的托管类型创建 Protocol 类的实例 (该实例必须表示 Objective-C 协议) 。

Protocol(IntPtr)

为指定的 Objective-C 协议创建 Protocol 类的实例。

public Protocol (IntPtr handle);
new ObjCRuntime.Protocol : nativeint -> ObjCRuntime.Protocol

参数

handle
IntPtr

nativeint

指向协议的 Objective-C 指针。

适用于

Protocol(String)

通过按名称查找协议来创建 Protocol 的实例。

public Protocol (string name);
new ObjCRuntime.Protocol : string -> ObjCRuntime.Protocol

参数

name
String

协议的名称。

注解

如果 指定的 name 协议不存在,此方法将引发 ArgumentException。

方法 GetHandle(String) 执行类似的角色,只不过它只返回协议的低级别句柄。

适用于

Protocol(Type)

为指定的托管类型创建 Protocol 类的实例 (该实例必须表示 Objective-C 协议) 。

public Protocol (Type type);
new ObjCRuntime.Protocol : Type -> ObjCRuntime.Protocol

参数

type
Type

托管类型 (,它必须表示 Objective-C 协议) 。

适用于