• 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: When do I need to override hash?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >When do I need to override hash? (From: Gideon King <email@hidden>)

  • Prev by Date: otest output in xUnit XML format?
  • Next by Date: Re: devil of a time with an NSImageView
  • Previous by thread: When do I need to override hash?
  • Next by thread: Re: When do I need to override hash?
  • Index(es):
    • Date
    • Thread