• 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
Implementing isEqual: and hash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Implementing isEqual: and hash


  • Subject: Implementing isEqual: and hash
  • From: Graham Cox <email@hidden>
  • Date: Sat, 23 Aug 2008 21:41:43 +1000

I have a class for which equality can be defined as having the same internal string value (which happens to be a UUID-turned-string). I can easily implement isEqual: based on that but the docs say I also need to implement -hash. Any pointers on what is a good way to do that? Could I just safely defer to the -hash returned by the string in question?

tia,

Graham


_______________________________________________

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: Implementing isEqual: and hash
      • From: Jim Correia <email@hidden>
    • Re: Implementing isEqual: and hash
      • From: Jean-Daniel Dupas <email@hidden>
    • Re: Implementing isEqual: and hash
      • From: "Michael Ash" <email@hidden>
    • Re: Implementing isEqual: and hash
      • From: Phil <email@hidden>
  • Prev by Date: Re: UTI Example
  • Next by Date: Re: Implementing isEqual: and hash
  • Previous by thread: Re: textfield not updating with bindings - Whats wrong?
  • Next by thread: Re: Implementing isEqual: and hash
  • Index(es):
    • Date
    • Thread