• 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: Kirk Kerekes <email@hidden>
  • Date: Fri, 21 Aug 2009 08:40:02 -0500

AFAIK, NSDictionary specifies that it COPIES keys, and RETAINS objects. Thus even if you were to use an NSMutableString as a key, you could not mutate the key in the NSDictionary. So the only way you are likely to get into trouble with keys is if you do troublesome things like use oddball mutable-only object types (or immutable collections with mutable content objects, or objects with mutable properties) as dictionary _keys_.

So don't do that.

_______________________________________________

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


  • Prev by Date: Setting multi line Text to Radio button
  • Next by Date: Re: iPhone: Accessing variable from another view controller
  • Previous by thread: Re: When do I need to override hash?
  • Next by thread: Layer-backed view confused by bounds transformation
  • Index(es):
    • Date
    • Thread