What is the equivalent of an NSDictionary in C#?
Is it a collection?
Its System.Collections.Generic.Dictionary<,>
To set an object (like setObject:forKey:
) you use:
Dictionary[Key] = Object;
To get an object (like objectForKey:
) you use:
var Object = Dictionary[Key];
You can also use the HashTable Class:
Example :
HashTable dict = new HashTable();
dict.Add("key", object);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With