NSDictionary<TKey,TValue> Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| NSDictionary<TKey,TValue>() |
Initializes a new instance of the NSDictionary<TKey,TValue> class. |
| NSDictionary<TKey,TValue>(NSCoder) |
A constructor that initializes the object from the data stored in the unarchiver object. |
| NSDictionary<TKey,TValue>(NSDictionary<TKey,TValue>) |
Initializes a new instance of the NSDictionary<TKey,TValue> class from another dictionary. |
| NSDictionary<TKey,TValue>(NSUrl) |
Initializes a new instance of the NSDictionary<TKey,TValue> class from a property list at the specified URL. |
| NSDictionary<TKey,TValue>(String) |
Initializes a new instance of the NSDictionary<TKey,TValue> class from a property list file. |
| NSDictionary<TKey,TValue>(TKey, TValue) |
Initializes a new instance of the NSDictionary<TKey,TValue> class with a single key-value pair. |
| NSDictionary<TKey,TValue>(TKey[], TValue[]) |
Initializes a new instance of the NSDictionary<TKey,TValue> class from parallel arrays of keys and values. |
NSDictionary<TKey,TValue>()
Initializes a new instance of the NSDictionary<TKey,TValue> class.
public NSDictionary();
Applies to
NSDictionary<TKey,TValue>(NSCoder)
A constructor that initializes the object from the data stored in the unarchiver object.
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)>
Parameters
- coder
- NSCoder
The unarchiver object.
Remarks
This constructor is provided to allow the class to be initialized from an unarchiver (for example, during NIB deserialization). This is part of the NSCoding protocol.
If developers want to create a subclass of this object and continue to support deserialization from an archive, they should implement a constructor with an identical signature: taking a single parameter of type NSCoder and decorate it with the [Export("initWithCoder:"] attribute declaration.
The state of this object can also be serialized by using the companion method, EncodeTo.
Applies to
NSDictionary<TKey,TValue>(NSDictionary<TKey,TValue>)
Initializes a new instance of the NSDictionary<TKey,TValue> class from another dictionary.
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)>
Parameters
The dictionary to copy from.
Applies to
NSDictionary<TKey,TValue>(NSUrl)
Initializes a new instance of the NSDictionary<TKey,TValue> class from a property list at the specified URL.
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)>
Parameters
- url
- NSUrl
The URL to a property list file.
Applies to
NSDictionary<TKey,TValue>(String)
Initializes a new instance of the NSDictionary<TKey,TValue> class from a property list file.
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)>
Parameters
- filename
- String
The path to a property list file.
Applies to
NSDictionary<TKey,TValue>(TKey, TValue)
Initializes a new instance of the NSDictionary<TKey,TValue> class with a single key-value pair.
public NSDictionary(TKey key, TValue value);
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)>
Parameters
- key
- TKey
The key.
- value
- TValue
The value.
Applies to
NSDictionary<TKey,TValue>(TKey[], TValue[])
Initializes a new instance of the NSDictionary<TKey,TValue> class from parallel arrays of keys and values.
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)>
Parameters
- keys
- TKey[]
An array of keys.
- values
- TValue[]
An array of values.