• 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: [Solved] Using key-value observing on NSUserDefaults
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Solved] Using key-value observing on NSUserDefaults


  • Subject: Re: [Solved] Using key-value observing on NSUserDefaults
  • From: Greg <email@hidden>
  • Date: Sun, 6 Jul 2008 18:13:43 -0400

Silly me, I needed to observe the controller itself, not the values... duh! :-p

[[NSUserDefaultsController sharedUserDefaultsController] addObserver:self
forKeyPath:[@"values." stringByAppendingString:preferenceKey]
options:NSKeyValueObservingOptionNew
context:NULL];


- Greg

On Jul 6, 2008, at 4:18 PM, Greg wrote:

I have a preferences controller (PreferencesController) that controls a preferences window. It would be quite nice if I could observe changes to all of the preferences via key-value observing. In IB I also have an NSUserDefaultsController that's hooked up to all the controls, I've tried observing its 'values' but that doesn't seem to work.

Thanks,

- Greg
_______________________________________________

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:
@kinostudios.com


This email sent to email@hidden

_______________________________________________

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


References: 
 >Using key-value observing on NSUserDefaults (From: Greg <email@hidden>)

  • Prev by Date: Re: [NSTextStorage/NSAttributedString] How can we know the height of a rendered string?
  • Next by Date: Re: garbage collection and NSConnection
  • Previous by thread: Using key-value observing on NSUserDefaults
  • Next by thread: [NSTextStorage/NSAttributedString] How can we know the height of a rendered string?
  • Index(es):
    • Date
    • Thread