mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-26 18:21:04 +00:00
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11388 72102866-910b-0410-8b05-ffd578937521
310 lines
10 KiB
XML
310 lines
10 KiB
XML
<?xml version="1.0"?>
|
|
<!DOCTYPE gsdoc PUBLIC "-//GNUstep//DTD gsdoc 0.6.6//EN" "http://www.gnustep.org/gsdoc-0_6_6.xml">
|
|
<gsdoc base="NSUserDefaults" prev="NSUndoManager" next="NSValue" up="Base">
|
|
<head>
|
|
<title>NSUserDefaults</title>
|
|
<author name="Richard Frith-Macdonald">
|
|
<email address="rfm@gnu.org"/>
|
|
<url url="http://www.gnustep.org/developers/whoiswho.html"/>
|
|
</author>
|
|
<version>$Revision$</version>
|
|
<date>$Date$</date>
|
|
</head>
|
|
<body>
|
|
<chapter>
|
|
<heading>NSUserDefaults</heading>
|
|
<class name="NSUserDefaults" super="NSObject">
|
|
<declared>Foundation/NSUserDefaults.h</declared>
|
|
<conform>NSObject</conform>
|
|
<desc>
|
|
<p>
|
|
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.
|
|
</p>
|
|
<p>
|
|
Defaults are managed based on <em>domains</em>. Certain
|
|
domains, such as <code>NSGlobalDomain</code>, 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.
|
|
</p>
|
|
<deflist>
|
|
<term><code>NSArgumentDomain</code></term>
|
|
<desc>
|
|
Contains defaults read from the arguments provided to
|
|
the application at startup. Volitile.
|
|
</desc>
|
|
<term>Application (name of the current process)</term>
|
|
<desc>
|
|
Application specific defaults, such as window positions. Persistant.
|
|
</desc>
|
|
<term><code>NSGlobalDomain</code></term>
|
|
<desc>
|
|
Global defaults. Persistant.
|
|
</desc>
|
|
<term>Language (name based on users's language)</term>
|
|
<desc>
|
|
Constants that help with localization to the users's
|
|
language. Volitle
|
|
</desc>
|
|
<term><code>NSRegistrationDomain</code></term>
|
|
<desc>
|
|
Temporary defaults set up by the application. Volitile.
|
|
</desc>
|
|
</deflist>
|
|
<p>
|
|
The <em>NSLanguages</em> default value is used to set up the
|
|
constants for localization. GNUstep will also look for the
|
|
<code>LANGUAGES</code> 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 <file>Languages</file> directory
|
|
of the GNUstep resources).
|
|
</p>
|
|
<p>
|
|
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 <em>NSLanguages</em>
|
|
default value is not found. Typically the locale is
|
|
specified in the environment with the <code>LANG</code>
|
|
environment variable.
|
|
</p>
|
|
</desc>
|
|
<method type="void" factory="yes">
|
|
<sel>resetStandardUserDefaults</sel>
|
|
<desc>
|
|
Resets the shared user defaults object to reflect the current
|
|
user ID. Needed by setuid processes whiich change the user they
|
|
are running as.
|
|
</desc>
|
|
</method>
|
|
<method type="NSUserDefaults*" factory="yes">
|
|
<sel>standardUserDefaults</sel>
|
|
<desc>
|
|
Returns a shared instance of the class containing the standard
|
|
defaults for the process.
|
|
</desc>
|
|
</method>
|
|
<method type="NSArray*" factory="yes">
|
|
<sel>userLanguages</sel>
|
|
<desc>
|
|
Returns the array of user languages preferences. Uses the
|
|
<em>NSLanguages</em> user default if available, otherwise
|
|
tries to infer setup from operating system information etc
|
|
(in particular, uses the <em>LANGUAGES</em> environment variable).
|
|
</desc>
|
|
<standards><GNUstep/><NotMacOS-X/><NotOpenStep/></standards>
|
|
</method>
|
|
<method type="void" factory="yes">
|
|
<sel>setUserLanguages:</sel>
|
|
<arg type="NSArray*">languages</arg>
|
|
<desc>
|
|
Sets the array of user languages preferences. Places the specified
|
|
array in the <em>NSLanguages</em> user default.
|
|
</desc>
|
|
<standards><GNUstep/><NotMacOS-X/><NotOpenStep/></standards>
|
|
</method>
|
|
<method type="NSArray*">
|
|
<sel>arrayForKey:</sel>
|
|
<arg type="NSString*">defaultName</arg>
|
|
<desc>
|
|
Looks up a value for a specified default, checks that it is
|
|
an array. Returns nil if it is not.
|
|
</desc>
|
|
</method>
|
|
<method type="BOOL">
|
|
<sel>boolForKey:</sel>
|
|
<arg type="NSString*">defaultName</arg>
|
|
<desc>
|
|
Looks up a value for a specified default, checks that it is
|
|
a boolean. Returns NO if it is not present.
|
|
</desc>
|
|
</method>
|
|
<method type="NSData*">
|
|
<sel>dataForKey:</sel>
|
|
<arg type="NSString*">defaultName</arg>
|
|
<desc>
|
|
Looks up a value for a specified default, checks that it is
|
|
an NSData object. Returns nil if it is not.
|
|
</desc>
|
|
</method>
|
|
<method type="NSDictionary*">
|
|
<sel>dictionaryForKey:</sel>
|
|
<arg type="NSString*">defaultName</arg>
|
|
<desc>
|
|
Looks up a value for a specified default, checks that it is
|
|
an NSDictionary object. Returns nil if it is not.
|
|
</desc>
|
|
</method>
|
|
<method type="NSDictionary*">
|
|
<sel>dictionaryRepresentation</sel>
|
|
<desc>
|
|
</desc>
|
|
</method>
|
|
<method type="float">
|
|
<sel>floatForKey:</sel>
|
|
<arg type="NSString*">defaultName</arg>
|
|
<desc>
|
|
</desc>
|
|
</method>
|
|
<method type="id">
|
|
<sel>init</sel>
|
|
<desc>
|
|
</desc>
|
|
</method>
|
|
<method type="id">
|
|
<sel>initWithUser:</sel>
|
|
<arg type="NSString*">username</arg>
|
|
<desc>
|
|
</desc>
|
|
</method>
|
|
<method type="int">
|
|
<sel>integerForKey:</sel>
|
|
<arg type="NSString*">defaultName</arg>
|
|
<desc>
|
|
</desc>
|
|
</method>
|
|
<method type="id">
|
|
<sel>objectForKey:</sel>
|
|
<arg type="NSString*">defaultName</arg>
|
|
<desc>
|
|
</desc>
|
|
</method>
|
|
<method type="NSDictionary*">
|
|
<sel>persistentDomainForName:</sel>
|
|
<arg type="NSString*">domainName</arg>
|
|
<desc>
|
|
</desc>
|
|
</method>
|
|
<method type="NSArray*">
|
|
<sel>persistentDomainNames</sel>
|
|
<desc>
|
|
</desc>
|
|
</method>
|
|
<method type="void">
|
|
<sel>registerDefaults:</sel>
|
|
<arg type="NSDictionary*">dictionary</arg>
|
|
<desc>
|
|
</desc>
|
|
</method>
|
|
<method type="void">
|
|
<sel>removeObjectForKey:</sel>
|
|
<arg type="NSString*">defaultName</arg>
|
|
<desc>
|
|
</desc>
|
|
</method>
|
|
<method type="void">
|
|
<sel>removePersistentDomainForName:</sel>
|
|
<arg type="NSString*">domainName</arg>
|
|
<desc>
|
|
</desc>
|
|
</method>
|
|
<method type="void">
|
|
<sel>removeVolatileDomainForName:</sel>
|
|
<arg type="NSString*">domainName</arg>
|
|
<desc>
|
|
</desc>
|
|
</method>
|
|
<method type="NSArray*">
|
|
<sel>searchList</sel>
|
|
<desc>
|
|
</desc>
|
|
</method>
|
|
<method type="void">
|
|
<sel>setBool:</sel>
|
|
<arg type="BOOL">value</arg>
|
|
<sel>forKey:</sel>
|
|
<arg type="NSString*">defaultName</arg>
|
|
<desc>
|
|
</desc>
|
|
</method>
|
|
<method type="void">
|
|
<sel>setFloat:</sel>
|
|
<arg type="float">value</arg>
|
|
<sel>forKey:</sel>
|
|
<arg type="NSString*">defaultName</arg>
|
|
<desc>
|
|
</desc>
|
|
</method>
|
|
<method type="void">
|
|
<sel>setInteger:</sel>
|
|
<arg type="int">value</arg>
|
|
<sel>forKey:</sel>
|
|
<arg type="NSString*">defaultName</arg>
|
|
<desc>
|
|
</desc>
|
|
</method>
|
|
<method type="void">
|
|
<sel>setObject:</sel>
|
|
<arg type="id">value</arg>
|
|
<sel>forKey:</sel>
|
|
<arg type="NSString*">defaultName</arg>
|
|
<desc>
|
|
</desc>
|
|
</method>
|
|
<method type="void">
|
|
<sel>setPersistentDomain:</sel>
|
|
<arg type="NSDictionary*">domain</arg>
|
|
<sel>forName:</sel>
|
|
<arg type="NSString*">domainName</arg>
|
|
<desc>
|
|
</desc>
|
|
</method>
|
|
<method type="void">
|
|
<sel>setSearchList:</sel>
|
|
<arg type="NSArray*">array</arg>
|
|
<desc>
|
|
</desc>
|
|
</method>
|
|
<method type="void">
|
|
<sel>setVolatileDomain:</sel>
|
|
<arg type="NSDictionary*">domain</arg>
|
|
<sel>forName:</sel>
|
|
<arg type="NSString*">domainName</arg>
|
|
<desc>
|
|
</desc>
|
|
</method>
|
|
<method type="NSArray*">
|
|
<sel>stringArrayForKey:</sel>
|
|
<arg type="NSString*">defaultName</arg>
|
|
<desc>
|
|
</desc>
|
|
</method>
|
|
<method type="NSString*">
|
|
<sel>stringForKey:</sel>
|
|
<arg type="NSString*">defaultName</arg>
|
|
<desc>
|
|
</desc>
|
|
</method>
|
|
<method type="BOOL">
|
|
<sel>synchronize</sel>
|
|
<desc>
|
|
</desc>
|
|
</method>
|
|
<method type="NSDictionary*">
|
|
<sel>volatileDomainForName:</sel>
|
|
<arg type="NSString*">domainName</arg>
|
|
<desc>
|
|
</desc>
|
|
</method>
|
|
<method type="NSArray*">
|
|
<sel>volatileDomainNames</sel>
|
|
<desc>
|
|
</desc>
|
|
</method>
|
|
</class>
|
|
</chapter>
|
|
</body>
|
|
</gsdoc>
|