How to get Notification of particular NSUserDefault keys (from the NSGlobalDomain)
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