• 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: Bindings Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bindings Problem


  • Subject: Re: Bindings Problem
  • From: Ken Thomases <email@hidden>
  • Date: Sun, 17 Jan 2010 17:57:38 -0600

On Jan 17, 2010, at 11:15 AM, Jeffrey Oleander wrote:

>> On Sat, 2010/01/16, Ken Thomases <email@hidden> wrote:
>>> On 2010 Jan 14, at 17:11, Carter R. Harrison wrote:
>>> My model is an NSMutableSet that contains
>>> NSMutableDictionaries.
>>
>> I think this is asking for trouble.  A set of mutable
>> dictionaries doesn't make much sense.
>>
>> ..."Equal" is determined by the -isEqual: and -hash
>> methods, not by identity (memory location).
>
> So, it's quite possible that he has a "hash" used by
> the NSMutableSet which doesn't depend on the contents
> of the mutable dictionary once it's been created.

Huh?  The hash in question is that of the mutable dictionaries.  He doesn't get to decide this.  It's a near certainty that the hash of a dictionary is sensitive to its contents.  First, logically, how else would the NSDictionary implement equality?  Second, the documentation I cited virtually asserted that it's so.

So, if you mutate a dictionary while it's inside a collection, that will cause trouble.  The documentation I cited says this, too, without equivocation.

He also doesn't get to decide on the hash of the set, if that's what you were thinking about.

He could implement some custom class and decide how its hash is implemented, but that's beside the point I was making.  In fact, that was one of my suggested solutions.

In other words, I'm not sure what you're trying to say.

Regards,
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: Bindings Problem
      • From: Jeffrey Oleander <email@hidden>
References: 
 >Re: Bindings Problem (From: Jeffrey Oleander <email@hidden>)

  • Prev by Date: [SOLVED]: Re: Can a model key path binding access a super class property
  • Next by Date: Re: If Array Controller is empty, how to populate pop-up list?
  • Previous by thread: Re: Bindings Problem
  • Next by thread: Re: Bindings Problem
  • Index(es):
    • Date
    • Thread