• 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
How to get Notification of particular NSUserDefault keys (from the NSGlobalDomain)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to get Notification of particular NSUserDefault keys (from the NSGlobalDomain)


  • Subject: How to get Notification of particular NSUserDefault keys (from the NSGlobalDomain)
  • From: Travis Griggs <email@hidden>
  • Date: Wed, 02 Nov 2011 11:47:29 -0700

I'm trying to create a language binding into the Cocoa environment. And my current problem is how to be able to determine when NSUserDefaults values have changed. I've read through all of these a couple of times:

http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html

http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Protocols/NSKeyValueObserving_Protocol/Reference/Reference.html

http://stackoverflow.com/questions/3166563/how-to-receive-nsuserdefaultsdidchangenotification-iphone
8:37 AM
http://stackoverflow.com/questions/1141388/cocoa-notification-on-nsuserdefaults-value-change

But I am unable to get a simple cocoa program that does this. I don't care if it's done with key-value stuff, or not, I just want to know when a user changes a value found in the NSGlobalDomain. In particular at the moment, the result I read with the command line expression

defaults read NSGlobalDomain AppleShowScrollBars

If anyone can tell me succinctly, what message I send to what, to get notification set up to be notified when that setting changes, I would be very very grateful. I've beat my head against this for a couple of days :(

--
Travis Griggs
Objologist
Simplicity is the Ultimate Sophistication -- Leonardo da Vinci

_______________________________________________

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: How to get Notification of particular NSUserDefault keys (from the NSGlobalDomain)
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: Sandbox issues
  • Next by Date: Issue with IOHIDDeviceOpen and Exclusive Access
  • Previous by thread: Re: Sandbox issues
  • Next by thread: Re: How to get Notification of particular NSUserDefault keys (from the NSGlobalDomain)
  • Index(es):
    • Date
    • Thread