• 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: Jeff Laing <email@hidden>
  • Date: Fri, 21 Aug 2009 02:45:38 +0000
  • Acceptlanguage: en-US
  • Thread-topic: When do I need to override hash?

> OK, so this discussion is getting a little crazy :-)

Agreed.

> The -hash method is important for objects that are used as keys in
> associative collections.
> [snip]
> So, in practice, it's perfectly safe in 99.9% of cases to base your
> hash off your object's properties.  In the specific case when you're
> mutating objects that are keys in associative collections
> (NSDictionary and NSSet being the primary examples, along with their
> CoreFoundation counterparts) ...

Is there any way that you can tell that some higher-level technology you are using (CoreData?) is putting your objects into an NSSet?  That's presumably a hidden implementation detail which you can't assume one way or the other with any safety?
_______________________________________________

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: When do I need to override hash?
      • From: Alastair Houghton <email@hidden>
References: 
 >When do I need to override hash? (From: Gideon King <email@hidden>)
 >Re: When do I need to override hash? (From: Seth Willits <email@hidden>)
 >Re: When do I need to override hash? (From: David Duncan <email@hidden>)
 >Re: When do I need to override hash? (From: Clark Cox <email@hidden>)
 >Re: When do I need to override hash? (From: Bryan Henry <email@hidden>)
 >Re: When do I need to override hash? (From: Clark Cox <email@hidden>)
 >Re: When do I need to override hash? (From: Kyle Sluder <email@hidden>)
 >Re: When do I need to override hash? (From: Shawn Erickson <email@hidden>)
 >Re: When do I need to override hash? (From: Clark Cox <email@hidden>)
 >Re: When do I need to override hash? (From: Kyle Sluder <email@hidden>)
 >Re: When do I need to override hash? (From: Clark Cox <email@hidden>)
 >Re: When do I need to override hash? (From: Alastair Houghton <email@hidden>)

  • Prev by Date: Re: How to reference to objects laid in external xibs in Interface Builder?
  • Next by Date: Re: Force crash a cocoa app for Crash Reporter testing
  • Previous by thread: Re: When do I need to override hash?
  • Next by thread: Re: When do I need to override hash?
  • Index(es):
    • Date
    • Thread