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: Clark Cox <email@hidden>
- Date: Thu, 20 Aug 2009 13:59:56 -0700
On Thu, Aug 20, 2009 at 1:37 PM, Kyle Sluder<email@hidden> wrote:
> On Thu, Aug 20, 2009 at 1:33 PM, Clark Cox<email@hidden> wrote:
>> -isEqual: is how Cocoa collections define equality. Saying that two
>> objects are "equal" means, by definition, that -[obj1 isEqual: obj2]
>> returns true.
>
> This has nothing to do with -hash.
>
> P: Two objects are equal.
> Q: They have the same hash.
>
> P -> Q.
>
> Note that Q does not imply P.
So, tell me how you can have two equal objects meet that condition,
when the hash is based on the pointer value of self.
--
Clark S. Cox III
email@hidden
_______________________________________________
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