Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Like <code>NSDictionary</code> (<a href="/questions/tagged/nsdictionary" class="post-tag" title="show questions tagged 'nsdictionary'" rel="tag">nsdictionary</a>), it is a subclass of <code>NSObject</code> (<a href="/questions/tagged/nsobject" class="post-tag" title="show questions tagged 'nsobject'" rel="tag">nsobject</a>), that allows you to have a collection of objects, but instead of having them stored in an array retrievable by their index, they are stored as a key-value pair. Each object stored in an <code>NSDictionary</code> can be retrieved by a unique key assigned to it. Keys have to be unique and can be any object as long as they adopt the <code>NSCopying</code> protocol – they are usually an instance of <code>NSString</code> (<a href="/questions/tagged/nsstring" class="post-tag" title="show questions tagged 'nsstring'" rel="tag">nsstring</a>).</p> <p>Neither a key nor the object paired with it can be nil, however, you may use <code>NSNull</code> for storing null objects.</p> <p>If two objects are stored with the same key, the first one is released, and the last one is stored.</p> <p>When using key-value coding, the key must be a string. When using key-object coding, the key is copied using <code>copyWithZone:</code> and it must conform to the <code>NSCopying</code> protocol. This object is retained, rather than copy.</p> <p><code>NSMutableDictionary</code> gives you the ability to modify this set of key-object paired collection without having to empty it and refill it again as a whole set. The following methods are for this purpose:</p> <p>Adding Entries to a Mutable Dictionary</p> <pre><code>– setObject:forKey: – setValue:forKey: – addEntriesFromDictionary: – setDictionary: </code></pre> <p>Removing Entries From a Mutable Dictionary</p> <pre><code>– removeObjectForKey: – removeAllObjects – removeObjectsForKeys: </code></pre> <h3>Resources:</h3> <ul> <li><a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSMutableDictionary_Class/Reference/Reference.html" rel="nofollow">NSMutableDictionary Class Reference</a>.</li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload