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: Kyle Sluder <email@hidden>
- Date: Wed, 19 Aug 2009 17:36:18 -0700
On Wed, Aug 19, 2009 at 4:28 PM, Gideon King<email@hidden> wrote:
> So do I need to override hash too? If so, are there any recommendations as
> to how to determine the hash easily?
You need to override -hash for the simple reason that the
documentation says you need to override -hash. That gives anyone else
license to assume you implement -hash if you implement -isEqual.
As for computing the hash itself, only you can answer that. The naïve
option is to just return your self pointer, but that's not going to
work well.
--Kyle Sluder
_______________________________________________
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