Re: Question about model observers
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