bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSUserDefaults bug or feature?


From: Kaelin Colclasure
Subject: NSUserDefaults bug or feature?
Date: Sat, 12 Jan 2002 01:49:26 -0800

The commented code in the function below is how defaults are presumably supposed to be set under Apple's Cocoa. However, doing it this way under GNUstep results in the default values being discarded. GNUstep's NSUserDefaults class seems to want all default values specified as strings.

void
register_defaults (NSUserDefaults * userDefaults)
{
  NSMutableDictionary * defaults = [NSMutableDictionary dictionary];
  // TODO: File this as a bug in GNUstep?
// [defaults setObject: [NSNumber numberWithBool: YES] forKey: @"spawn"]; // [defaults setObject: [NSNumber numberWithInt: 1] forKey: @"workers"];
  [defaults setObject: @"yes" forKey: @"spawn"];
  [defaults setObject: @"1" forKey: @"workers"];
  [userDefaults registerDefaults: defaults];
}

So is this a GNUstep bug or feature?

-- Kaelin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]