Re: When do I need to override hash?
Re: When do I need to override hash?
- Subject: Re: When do I need to override hash?
- From: Seth Willits <email@hidden>
- Date: Thu, 20 Aug 2009 12:00:44 -0700
From the docs:
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 thehash 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.
That's pretty hard to deal with.
Returning 0 is certainly simpler :p
--
Seth Willits
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden