• 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
NSUserDefaultsDidChangeNotification with NSUserDefaultsController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSUserDefaultsDidChangeNotification with NSUserDefaultsController


  • Subject: NSUserDefaultsDidChangeNotification with NSUserDefaultsController
  • From: "Sean McBride" <email@hidden>
  • Date: Tue, 3 Aug 2004 01:00:32 -0400

Hi,

I'm trying to understand exactly when NSUserDefaultsDidChangeNotification
is posted. Or, more generally, when using NSUserDefaultsController, when
and how can I act on the changed preferences?

mmalc's "ControlledPreferences" example has been very useful, but I
notice what I consider a strange behaviour:

- if I change the textfield, NSUserDefaultsDidChangeNotification is
posted once
- the 1st time I click the colourwell (without changing colours), its
posted 4 times
- subsequent times, its not posted at all unless i change colours
- same thing with the 'fonts' button
- clicking the 'factory' button also gets me 4 postings

4 is the number of keys this app has in its defaults database.

In my app, the same happens. But in response to the changed prefs, I
need to do a lengthy operation, and so doing it 4 times is bad. :)

I may turn off the 'appliesImmediately' flag, but I'd still like to
understand when things are posted. Apple's docs say only "This
notification is posted the first time after a synchronize when a change
is made to defaults in a persistent domain" which doesn't mean much to me.

Thanks!
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Prev by Date: Unselecting a Pref Pane
  • Next by Date: Re: Unselecting a Pref Pane
  • Previous by thread: Re: Unselecting a Pref Pane
  • Next by thread: Re: Binding woes, connecting model to NSArrayController, crash on remove/insert
  • Index(es):
    • Date
    • Thread