Re: Differences between -isEqual: and -isEqualTo:?
Re: Differences between -isEqual: and -isEqualTo:?
- Subject: Re: Differences between -isEqual: and -isEqualTo:?
- From: Shawn Erickson <email@hidden>
- Date: Thu, 18 Sep 2008 17:44:48 -0700
On Sep 18, 2008, at 5:33 PM, Ken Thomases wrote:
Another counterexample is an object which doesn't provide value
semantics. That is, its -isEqual: only tests identify (pointer
comparison) and whose hash is purely based on the object pointer.
..or say a "person" object which is considered equal if two person
objects have the same email address while all other attributes of the
object (say phone number, first name, last name, etc.) are not a
factor when considering equality. In this case you can safely mutate
all properties of said person object except for email address if that
object is being used in a collection (or data structure) that depends
on hash or isEqual: for its storage and look up.
-Shawn
_______________________________________________
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