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 還原序列化) 期間,從 unarchiver (初始化 類別。 這是通訊協定的 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[]