I've noticed something weird with getting this notification.  In the
NSLocale code I add the NSLocale class as an observer so that
autoupdatingCurrentLocale can be updated but don't always get a notification
as I'd expect.

The code below outputs:
2011-01-29 09:41:48.404 test[8928] en_US
2011-01-29 09:41:48.406 test[8928] en_US
if there is no "Locale" default in "test" domain.  If I set the default
before hand (defaults write test Locale "en_US") it is:
2011-01-29 09:44:44.397 test[8961] en_US
2011-01-29 09:44:44.398 test[8961] pt_BR

Is this correct?  I don't fully grasp the defaults and notification system
yet but I expected to get a notification anytime the defaults changed.  If
this is, in fact, what is supposed to be happening, how can I get a
notification not only when the default change but also whenever it's added?

  {
    NSLocale *autoLocale = [NSLocale autoupdatingCurrentLocale];
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    NSLog (@"%@", autoLocale);
    [defaults setObject: @"pt_BR" forKey: @"Locale"];
    [defaults synchronize];
    NSLog (@"%@", autoLocale);
  }

Stef
_______________________________________________
Gnustep-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to