NSDictionary/NSMutableDictionary
A dictionary is a collection of key-value pairs. The key is typically a string, and the value can be any sort of object. Dictionaries are indexed by key: you provide a key and get back the value (an object) associated with that particular key. Keys in a dictionary are unique and a dictionary’s key-value pairs are not kept in any particular order.
Like arrays and sets, dictionaries can be mutable (NSMutableDictionary) or immutable (NSDictionary).
Like NSArray, NSDictionary has a shorthand you can use when creating an immutable dictionary.
The dictionary literal syntax is formed with the @ symbol and curly braces. Within the curly braces, you provide a comma-delimited list of the key-value pairs and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access