• 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: Question about model observers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about model observers


  • Subject: Re: Question about model observers
  • From: Keary Suska <email@hidden>
  • Date: Wed, 12 May 2010 07:32:10 -0600

On May 11, 2010, at 7:48 PM, Ken Thomases wrote:

> On May 11, 2010, at 10:17 AM, Keary Suska wrote:
>
>> There have been some lengthy discussions about this. An object may choose to emit KVO notifications for its collection properties (but this behavior should never be expected unless it is specifically documented), but no collection will ever emit a KVO notification that its contents have changed (unless, of course, you subclass and add this behavior).
>
> Depends on whether you consider a dictionary a collection or not.  NSMutableDictionary does emit KVO notifications when its contents change.
>
> I suspect you were thinking of sets and arrays, in which case you're correct.

Yes, this is an important distinction. I often forget about dictionaries since, in my mind, they behave much more like regular objects and themselves tend to represent properties rather than relationships. But they are a collection, and they will emit KVO notifications for contents.

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

_______________________________________________

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: Question about model observers
      • From: Quincey Morris <email@hidden>
References: 
 >Question about model observers (From: Eric Giguere <email@hidden>)
 >Re: Question about model observers (From: Keary Suska <email@hidden>)
 >Re: Question about model observers (From: Eric Giguere <email@hidden>)
 >Re: Question about model observers (From: Keary Suska <email@hidden>)
 >Re: Question about model observers (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: To know what shows in the first line of a multiline NSTextField
  • Next by Date: Re: Question about model observers
  • Previous by thread: Re: Question about model observers
  • Next by thread: Re: Question about model observers
  • Index(es):
    • Date
    • Thread