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

NSDictionary setValue KVO


  • Subject: NSDictionary setValue KVO
  • From: Trygve Inda <email@hidden>
  • Date: Sun, 10 Oct 2010 11:54:53 +0000
  • Thread-topic: NSDictionary setValue KVO

I have a controller object with an ivar "myDict"

I have a nib with an NSArrayController bound to this object with a keypath
of myDict.@allValues

This works, but when I want to add an item to the dict (and have it
reflected in the arraycontroller), the method in my object is:

[self willChangeValueForKey:@"myDict"];

NSDictionary*  test =
[NSDictionary dictionaryWithObjectsAndKeys:@"someValue", @"someKey", nil];

[myDict setValue:test forKey:@"someOtherKey"];

[self didChangeValueForKey:@"myDict"];


This works too, but how can I do this without the willChange/didChange ?

Shoudln't the setValue call, fire a KVO message?

Thanks,

Trygve


_______________________________________________

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: Keary Suska <email@hidden>
  • Prev by Date: Re: Identifying Cocoa Methods
  • Next by Date: How did gcc handle synthesized atomic vs custom nonatomic setter/getter?
  • Previous by thread: Re: Efficiently exporting CoreData objects as CSV
  • Next by thread: Re: NSDictionary setValue KVO
  • Index(es):
    • Date
    • Thread