NSDictionary<TKey,TValue> 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
NSDictionary<TKey,TValue>()
public NSDictionary ();
适用于
NSDictionary<TKey,TValue>(NSCoder)
从 unarchiver 对象中存储的数据初始化 对象的构造函数。
public NSDictionary (Foundation.NSCoder coder);
new Foundation.NSDictionary<'Key, 'Value (requires 'Key : null and 'Key :> ObjCRuntime.INativeObject and 'Value : null and 'Value :> ObjCRuntime.INativeObject)> : Foundation.NSCoder -> Foundation.NSDictionary<'Key, 'Value (requires 'Key : null and 'Key :> ObjCRuntime.INativeObject and 'Value : null and 'Value :> ObjCRuntime.INativeObject)>
参数
- coder
- NSCoder
unarchiver 对象。
注解
提供此构造函数是为了允许从非架构 (初始化类,例如,在 NIB 反序列化) 期间。 这是协议的一 NSCoding 部分。
如果开发人员想要创建此对象的子类并继续支持从存档反序列化,则应实现具有相同签名的构造函数:采用类型的 NSCoder 单个参数,并使用 [Export (“initWithCoder:”] 属性声明修饰它。
也可以使用配套方法 EncodeTo 对此对象的状态进行序列化。
适用于
NSDictionary<TKey,TValue>(NSDictionary<TKey,TValue>)
public NSDictionary (Foundation.NSDictionary<TKey,TValue> other);
new Foundation.NSDictionary<'Key, 'Value (requires 'Key : null and 'Key :> ObjCRuntime.INativeObject and 'Value : null and 'Value :> ObjCRuntime.INativeObject)> : Foundation.NSDictionary<'Key, 'Value (requires 'Key : null and 'Key :> ObjCRuntime.INativeObject and 'Value : null and 'Value :> ObjCRuntime.INativeObject)> -> Foundation.NSDictionary<'Key, 'Value (requires 'Key : null and 'Key :> ObjCRuntime.INativeObject and 'Value : null and 'Value :> ObjCRuntime.INativeObject)>
参数
适用于
NSDictionary<TKey,TValue>(NSUrl)
public NSDictionary (Foundation.NSUrl url);
new Foundation.NSDictionary<'Key, 'Value (requires 'Key : null and 'Key :> ObjCRuntime.INativeObject and 'Value : null and 'Value :> ObjCRuntime.INativeObject)> : Foundation.NSUrl -> Foundation.NSDictionary<'Key, 'Value (requires 'Key : null and 'Key :> ObjCRuntime.INativeObject and 'Value : null and 'Value :> ObjCRuntime.INativeObject)>
参数
- url
- NSUrl
适用于
NSDictionary<TKey,TValue>(String)
public NSDictionary (string filename);
new Foundation.NSDictionary<'Key, 'Value (requires 'Key : null and 'Key :> ObjCRuntime.INativeObject and 'Value : null and 'Value :> ObjCRuntime.INativeObject)> : string -> Foundation.NSDictionary<'Key, 'Value (requires 'Key : null and 'Key :> ObjCRuntime.INativeObject and 'Value : null and 'Value :> ObjCRuntime.INativeObject)>
参数
- filename
- String
适用于
NSDictionary<TKey,TValue>(TKey, TValue)
public NSDictionary (TKey key, TValue value);
new Foundation.NSDictionary<'Key, 'Value (requires 'Key : null and 'Key :> ObjCRuntime.INativeObject and 'Value : null and 'Value :> ObjCRuntime.INativeObject)> : 'Key * 'Value -> Foundation.NSDictionary<'Key, 'Value (requires 'Key : null and 'Key :> ObjCRuntime.INativeObject and 'Value : null and 'Value :> ObjCRuntime.INativeObject)>
参数
- key
- TKey
- value
- TValue
适用于
NSDictionary<TKey,TValue>(TKey[], TValue[])
public NSDictionary (TKey[] keys, TValue[] values);
new Foundation.NSDictionary<'Key, 'Value (requires 'Key : null and 'Key :> ObjCRuntime.INativeObject and 'Value : null and 'Value :> ObjCRuntime.INativeObject)> : 'Key[] * 'Value[] -> Foundation.NSDictionary<'Key, 'Value (requires 'Key : null and 'Key :> ObjCRuntime.INativeObject and 'Value : null and 'Value :> ObjCRuntime.INativeObject)>
参数
- keys
- TKey[]
- values
- TValue[]