Share via


NSMutableDictionary<TKey,TValue> 构造函数

定义

重载

NSMutableDictionary<TKey,TValue>()
NSMutableDictionary<TKey,TValue>(NSCoder)

从 unarchiver 对象中存储的数据初始化 对象的构造函数。

NSMutableDictionary<TKey,TValue>(NSDictionary<TKey,TValue>)
NSMutableDictionary<TKey,TValue>(NSMutableDictionary<TKey,TValue>)
NSMutableDictionary<TKey,TValue>(TKey, TValue)
NSMutableDictionary<TKey,TValue>(TKey[], TValue[])

NSMutableDictionary<TKey,TValue>()

public NSMutableDictionary ();

适用于

NSMutableDictionary<TKey,TValue>(NSCoder)

从 unarchiver 对象中存储的数据初始化 对象的构造函数。

public NSMutableDictionary (Foundation.NSCoder coder);
new Foundation.NSMutableDictionary<'Key, 'Value (requires 'Key : null and 'Key :> ObjCRuntime.INativeObject and 'Value : null and 'Value :> ObjCRuntime.INativeObject)> : Foundation.NSCoder -> Foundation.NSMutableDictionary<'Key, 'Value (requires 'Key : null and 'Key :> ObjCRuntime.INativeObject and 'Value : null and 'Value :> ObjCRuntime.INativeObject)>

参数

coder
NSCoder

unarchiver 对象。

注解

提供此构造函数是为了允许从 unarchiver (初始化类,例如,在 NIB 反序列化) 期间。 这是协议的一 NSCoding 部分。

如果开发人员想要创建此对象的子类并继续支持对存档进行反序列化,则应实现具有相同签名的构造函数:采用类型的 NSCoder 单个参数,并使用 [Export (“initWithCoder:”] 属性声明对其进行修饰。

也可以使用配套方法 EncodeTo 序列化此对象的状态。

适用于

NSMutableDictionary<TKey,TValue>(NSDictionary<TKey,TValue>)

public NSMutableDictionary (Foundation.NSDictionary<TKey,TValue> other);
new Foundation.NSMutableDictionary<'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.NSMutableDictionary<'Key, 'Value (requires 'Key : null and 'Key :> ObjCRuntime.INativeObject and 'Value : null and 'Value :> ObjCRuntime.INativeObject)>

参数

适用于

NSMutableDictionary<TKey,TValue>(NSMutableDictionary<TKey,TValue>)

public NSMutableDictionary (Foundation.NSMutableDictionary<TKey,TValue> other);
new Foundation.NSMutableDictionary<'Key, 'Value (requires 'Key : null and 'Key :> ObjCRuntime.INativeObject and 'Value : null and 'Value :> ObjCRuntime.INativeObject)> : Foundation.NSMutableDictionary<'Key, 'Value (requires 'Key : null and 'Key :> ObjCRuntime.INativeObject and 'Value : null and 'Value :> ObjCRuntime.INativeObject)> -> Foundation.NSMutableDictionary<'Key, 'Value (requires 'Key : null and 'Key :> ObjCRuntime.INativeObject and 'Value : null and 'Value :> ObjCRuntime.INativeObject)>

参数

适用于

NSMutableDictionary<TKey,TValue>(TKey, TValue)

public NSMutableDictionary (TKey key, TValue value);
new Foundation.NSMutableDictionary<'Key, 'Value (requires 'Key : null and 'Key :> ObjCRuntime.INativeObject and 'Value : null and 'Value :> ObjCRuntime.INativeObject)> : 'Key * 'Value -> Foundation.NSMutableDictionary<'Key, 'Value (requires 'Key : null and 'Key :> ObjCRuntime.INativeObject and 'Value : null and 'Value :> ObjCRuntime.INativeObject)>

参数

key
TKey
value
TValue

适用于

NSMutableDictionary<TKey,TValue>(TKey[], TValue[])

public NSMutableDictionary (TKey[] keys, TValue[] values);
new Foundation.NSMutableDictionary<'Key, 'Value (requires 'Key : null and 'Key :> ObjCRuntime.INativeObject and 'Value : null and 'Value :> ObjCRuntime.INativeObject)> : 'Key[] * 'Value[] -> Foundation.NSMutableDictionary<'Key, 'Value (requires 'Key : null and 'Key :> ObjCRuntime.INativeObject and 'Value : null and 'Value :> ObjCRuntime.INativeObject)>

参数

keys
TKey[]
values
TValue[]

适用于