• 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: NSDictionary setValue KVO
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDictionary setValue KVO


  • Subject: Re: NSDictionary setValue KVO
  • From: Ken Thomases <email@hidden>
  • Date: Sun, 10 Oct 2010 15:49:42 -0500

On Oct 10, 2010, at 3:19 PM, Kyle Sluder wrote:

> On Sun, Oct 10, 2010 at 12:57 PM, Ken Thomases <email@hidden> wrote:
>> A quick test program on Snow Leopard: a) confirms that NSMutableDictionary sends out change notifications for its keys, but b) does not send out change notifications for the allValues property.
>
> A quick test program also confirms that either I stink at writing
> quick test programs or NSDictionary does not send out old/new values
> in the change dictionary.
>
> http://gist.github.com/619529

Hate to tell you, but you stink at writing quick test programs. ;P

Your invocation of -addObserver:... specified 0 for the options.  You have to specify NSKeyValueObservingOptionNew to get the new value and/or NSKeyValueObservingOptionOld to get the old value.  I modified your test program to specify both and got:

2010-10-10 15:48:39.970 Untitled2[47695:903] root.key1 changed string1 -> differentString

Cheers,
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: NSDictionary setValue KVO
      • From: Kyle Sluder <email@hidden>
References: 
 >NSDictionary setValue KVO (From: Trygve Inda <email@hidden>)
 >Re: NSDictionary setValue KVO (From: Keary Suska <email@hidden>)
 >Re: NSDictionary setValue KVO (From: Ken Thomases <email@hidden>)
 >Re: NSDictionary setValue KVO (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: NSDictionary allValues not mutable
  • Next by Date: Re: NSDictionary setValue KVO
  • Previous by thread: Re: NSDictionary setValue KVO
  • Next by thread: Re: NSDictionary setValue KVO
  • Index(es):
    • Date
    • Thread