• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Differences between -isEqual: and -isEqualTo:?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Differences between -isEqual: and -isEqualTo:?


  • Subject: Re: Differences between -isEqual: and -isEqualTo:?
  • From: Ken Thomases <email@hidden>
  • Date: Thu, 18 Sep 2008 17:21:45 -0500

On Sep 18, 2008, at 5:15 PM, Charles Srstka wrote:

On Sep 18, 2008, at 4:59 PM, Dave DeLong wrote:

IIRC, isEqual: compares memory addresses, whereas isEqualTo: compares hashes of the objects being compared. I also believe that isEqual: is the preferred method.

The documentation says that isEqual: checks the hashes, so that isn't it.

No, it doesn't. It says that if two objects compare equal, then they must have the same hash. This is a not for overriders of -isEqual: to make sure they know that they have to implement a corresponding -hash that maintains this invariant rule.


Cheers,
Ken

_______________________________________________

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


  • Follow-Ups:
    • Re: Differences between -isEqual: and -isEqualTo:?
      • From: Keith Duncan <email@hidden>
References: 
 >Differences between -isEqual: and -isEqualTo:? (From: Rick Mann <email@hidden>)
 >Re: Differences between -isEqual: and -isEqualTo:? (From: Dave DeLong <email@hidden>)
 >Re: Differences between -isEqual: and -isEqualTo:? (From: Charles Srstka <email@hidden>)

  • Prev by Date: Re: Differences between -isEqual: and -isEqualTo:?
  • Next by Date: Re: Differences between -isEqual: and -isEqualTo:?
  • Previous by thread: Re: Differences between -isEqual: and -isEqualTo:?
  • Next by thread: Re: Differences between -isEqual: and -isEqualTo:?
  • Index(es):
    • Date
    • Thread