 <p>Note that if you're creating a object that can be mutated after creation, the hash value must <em>not change</em> if the object is inserted into a collection. Practically speaking, this means that the hash value must be fixed from the point of the initial object creation. See <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Protocols/NSObject_Protocol/Reference/NSObject.html#//apple_ref/doc/uid/20000052-BBCGFFCH" rel="nofollow noreferrer">Apple's documentation on the NSObject protocol's -hash method</a> for more information:</p> <blockquote> <p>If a mutable object is added to a collection that uses hash values to determine the object’s position in the collection, the value returned by the hash method of the object must not change while the object is in the collection. Therefore, either the hash method must not rely on any of the object’s internal state information or you must make sure the object’s internal state information does not change while the object is in the collection. Thus, for example, a mutable dictionary can be put in a hash table but you must not change it while it is in there. (Note that it can be difficult to know whether or not a given object is in a collection.)</p> </blockquote> <p>This sounds like complete whackery to me since it potentially effectively renders hash lookups far less efficient, but I suppose it's better to err on the side of caution and follow what the documentation says.</p>