NSUserDefaults $Revision$ $Date$ NSUserDefaults Foundation/NSUserDefaults.h NSObject

NSUserDefaults provides an interface to the defaults system, which allows an application access to global and/or application specific defualts set by the user. A particular instance of NSUserDefaults, standardUserDefaults, is provided as a convenience. Most of the information described below pertains to the standardUserDefaults. It is unlikely that you would want to instantiate your own userDefaults object, since it would not be set up in the same way as the standardUserDefaults.

Defaults are managed based on domains. Certain domains, such as NSGlobalDomain, are persistant. These domains have defaults that are stored externally. Other domains are volitale. The defaults in these domains remain in effect only during the existance of the application and may in fact be different for applications running at the same time. When asking for a default value from standardUserDefaults, NSUserDefaults looks through the various domains in a particular order.

NSArgumentDomain Contains defaults read from the arguments provided to the application at startup. Volitile. Application (name of the current process) Application specific defaults, such as window positions. Persistant. NSGlobalDomain Global defaults. Persistant. Language (name based on users's language) Constants that help with localization to the users's language. Volitle NSRegistrationDomain Temporary defaults set up by the application. Volitile.

The Languages default value is used to set up the constants for localization. GNUstep will also look for the LANGUAGES environment variable if it is not set in the defaults system. If it exists, it consists of an array of languages that the user prefers. At least one of the languages should have a corresponding localization file (typically located in the Languages directory of the GNUstep resources).

As a special extension, on systems that support locales (e.g. GNU/Linux and Solaris), GNUstep will use information from the user specified locale, if the Languages default value is not found. Typically the locale is specified in the environment with the LANG environment variable.

standardUserDefaults arrayForKey: defaultName boolForKey: defaultName dataForKey: defaultName dictionaryForKey: defaultName dictionaryRepresentation floatForKey: defaultName init initWithUser: username integerForKey: defaultName objectForKey: defaultName persistentDomainForName: domainName persistentDomainNames registerDefaults: dictionary removeObjectForKey: defaultName removePersistentDomainForName: domainName removeVolatileDomainForName: domainName searchList setBool: value forKey: defaultName setFloat: value forKey: defaultName setInteger: value forKey: defaultName setObject: value forKey: defaultName setPersistentDomain: domain forName: domainName setSearchList: array setVolatileDomain: domain forName: domainName stringArrayForKey: defaultName stringForKey: defaultName synchronize volatileDomainForName: domainName volatileDomainNames