I want to get some notification in my Cocoa app when the user changes some of the user defaults from the Terminal by using "defaults write ....". Is this even possible?
Asked
Active
Viewed 141 times
1
-
Did you try whether this approach works for you: [Notification on NSUserDefaults value change](http://stackoverflow.com/questions/1141388/cocoa-notification-on-nsuserdefaults-value-change?rq=1)? – Jay Apr 02 '13 at 07:19
-
I did try it but it doesn't work when the defaults are changed from the terminal. – icocoa Apr 02 '13 at 08:31
1 Answers
0
I'm not sure if it's possible. You should try using key-value observing (KVO) on NSUserDefaultsController
. You would observe the +sharedUserDefaultsController
for changes in the key path values.<your default key>
.

Ken Thomases
- 88,520
- 7
- 116
- 154