~ubuntu-branches/ubuntu/karmic/gnustep-base/karmic

« back to all changes in this revision

Viewing changes to Documentation/gsdoc/NSUserDefaults.gsdoc

  • Committer: Bazaar Package Importer
  • Author(s): Eric Heintzmann
  • Date: 2005-04-17 00:14:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050417001438-enf0y07c9tku85z1
Tags: 1.10.3-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?xml version="1.0"?>
2
 
<!DOCTYPE gsdoc PUBLIC "-//GNUstep//DTD gsdoc 0.6.6//EN" "http://www.gnustep.org/gsdoc-0_6_6.xml">
3
 
<gsdoc base="NSUserDefaults" prev="NSUndoManager" next="NSValue" up="Base">
4
 
  <head>
5
 
    <title>NSUserDefaults</title>
6
 
    <author name="Richard Frith-Macdonald">
7
 
      <email address="rfm@gnu.org"/>
8
 
      <url url="http://www.gnustep.org/developers/whoiswho.html"/>
9
 
    </author>
10
 
    <version>$Revision: 1.11 $</version>
11
 
    <date>$Date: 2001/11/13 07:44:57 $</date>
12
 
  </head>
13
 
  <body>
14
 
    <chapter>
15
 
      <heading>NSUserDefaults</heading>
16
 
      <class name="NSUserDefaults" super="NSObject">
17
 
        <declared>Foundation/NSUserDefaults.h</declared>
18
 
        <conform>NSObject</conform>
19
 
          <desc>
20
 
          <p>
21
 
          NSUserDefaults provides an interface to the defaults system,
22
 
          which allows an application access to global and/or application
23
 
          specific defualts set by the user. A particular instance of
24
 
          NSUserDefaults, standardUserDefaults, is provided as a
25
 
          convenience. Most of the information described below
26
 
          pertains to the standardUserDefaults. It is unlikely
27
 
          that you would want to instantiate your own userDefaults
28
 
          object, since it would not be set up in the same way as the
29
 
          standardUserDefaults. 
30
 
          </p>
31
 
          <p>
32
 
          Defaults are managed based on <em>domains</em>. Certain
33
 
          domains, such as <code>NSGlobalDomain</code>, are
34
 
          persistant. These domains have defaults that are stored
35
 
          externally. Other domains are volitale. The defaults in
36
 
          these domains remain in effect only during the existance of
37
 
          the application and may in fact be different for
38
 
          applications running at the same time. When asking for a
39
 
          default value from standardUserDefaults, NSUserDefaults
40
 
          looks through the various domains in a particular order.
41
 
          </p>
42
 
          <deflist>
43
 
            <term><code>NSArgumentDomain</code></term>
44
 
            <desc>
45
 
            Contains defaults read from the arguments provided to
46
 
            the application at startup. Volitile.
47
 
            </desc>
48
 
            <term>Application (name of the current process)</term>
49
 
            <desc>
50
 
            Application specific defaults, such as window positions. Persistant.
51
 
            </desc>
52
 
            <term><code>NSGlobalDomain</code></term>
53
 
            <desc>
54
 
            Global defaults. Persistant.
55
 
            </desc>
56
 
            <term>Language (name based on users's language)</term>
57
 
            <desc>
58
 
            Constants that help with localization to the users's
59
 
            language. Volitle
60
 
            </desc>
61
 
            <term><code>NSRegistrationDomain</code></term>
62
 
            <desc>
63
 
            Temporary defaults set up by the application. Volitile.
64
 
            </desc>
65
 
          </deflist>
66
 
          <p>
67
 
          The <em>NSLanguages</em> default value is used to set up the
68
 
          constants for localization. GNUstep will also look for the
69
 
          <code>LANGUAGES</code> environment variable if it is not set
70
 
          in the defaults system. If it exists, it consists of an
71
 
          array of languages that the user prefers. At least one of
72
 
          the languages should have a corresponding localization file
73
 
          (typically located in the <file>Languages</file> directory
74
 
          of the GNUstep resources).
75
 
          </p>
76
 
          <p>
77
 
          As a special extension, on systems that support locales
78
 
          (e.g. GNU/Linux and Solaris), GNUstep will use information
79
 
          from the user specified locale, if the <em>NSLanguages</em>
80
 
          default value is not found. Typically the locale is
81
 
          specified in the environment with the <code>LANG</code>
82
 
          environment variable.
83
 
          </p>
84
 
          </desc>
85
 
        <method type="void" factory="yes">
86
 
          <sel>resetStandardUserDefaults</sel>
87
 
          <desc>
88
 
            Resets the shared user defaults object to reflect the current
89
 
            user ID.  Needed by setuid processes whiich change the user they
90
 
            are running as.
91
 
          </desc>
92
 
        </method>
93
 
        <method type="NSUserDefaults*" factory="yes">
94
 
          <sel>standardUserDefaults</sel>
95
 
          <desc>
96
 
            Returns a shared instance of the class containing the standard
97
 
            defaults for the process.
98
 
          </desc>
99
 
        </method>
100
 
        <method type="NSArray*" factory="yes">
101
 
          <sel>userLanguages</sel>
102
 
          <desc>
103
 
            Returns the array of user languages preferences.  Uses the
104
 
            <em>NSLanguages</em> user default if available, otherwise
105
 
            tries to infer setup from operating system information etc
106
 
            (in particular, uses the <em>LANGUAGES</em> environment variable).
107
 
          </desc>
108
 
          <standards><GNUstep/><NotMacOS-X/><NotOpenStep/></standards>
109
 
        </method>
110
 
        <method type="void" factory="yes">
111
 
          <sel>setUserLanguages:</sel>
112
 
          <arg type="NSArray*">languages</arg>
113
 
          <desc>
114
 
            Sets the array of user languages preferences.  Places the specified
115
 
            array in the <em>NSLanguages</em> user default.
116
 
          </desc>
117
 
          <standards><GNUstep/><NotMacOS-X/><NotOpenStep/></standards>
118
 
        </method>
119
 
        <method type="NSArray*">
120
 
          <sel>arrayForKey:</sel>
121
 
          <arg type="NSString*">defaultName</arg>
122
 
          <desc>
123
 
            Looks up a value for a specified default, checks that it is
124
 
            an array.  Returns nil if it is not.
125
 
          </desc>
126
 
        </method>
127
 
        <method type="BOOL">
128
 
          <sel>boolForKey:</sel>
129
 
          <arg type="NSString*">defaultName</arg>
130
 
          <desc>
131
 
            Looks up a value for a specified default, checks that it is
132
 
            a boolean.  Returns NO if it is not present.
133
 
          </desc>
134
 
        </method>
135
 
        <method type="NSData*">
136
 
          <sel>dataForKey:</sel>
137
 
          <arg type="NSString*">defaultName</arg>
138
 
          <desc>
139
 
            Looks up a value for a specified default, checks that it is
140
 
            an NSData object.  Returns nil if it is not.
141
 
          </desc>
142
 
        </method>
143
 
        <method type="NSDictionary*">
144
 
          <sel>dictionaryForKey:</sel>
145
 
          <arg type="NSString*">defaultName</arg>
146
 
          <desc>
147
 
            Looks up a value for a specified default, checks that it is
148
 
            an NSDictionary object.  Returns nil if it is not.
149
 
          </desc>
150
 
        </method>
151
 
        <method type="NSDictionary*">
152
 
          <sel>dictionaryRepresentation</sel>
153
 
          <desc>
154
 
          </desc>
155
 
        </method>
156
 
        <method type="float">
157
 
          <sel>floatForKey:</sel>
158
 
          <arg type="NSString*">defaultName</arg>
159
 
          <desc>
160
 
          </desc>
161
 
        </method>
162
 
        <method type="id">
163
 
          <sel>init</sel>
164
 
          <desc>
165
 
          </desc>
166
 
        </method>
167
 
        <method type="id">
168
 
          <sel>initWithUser:</sel>
169
 
          <arg type="NSString*">username</arg>
170
 
          <desc>
171
 
          </desc>
172
 
        </method>
173
 
        <method type="int">
174
 
          <sel>integerForKey:</sel>
175
 
          <arg type="NSString*">defaultName</arg>
176
 
          <desc>
177
 
          </desc>
178
 
        </method>
179
 
        <method type="id">
180
 
          <sel>objectForKey:</sel>
181
 
          <arg type="NSString*">defaultName</arg>
182
 
          <desc>
183
 
          </desc>
184
 
        </method>
185
 
        <method type="NSDictionary*">
186
 
          <sel>persistentDomainForName:</sel>
187
 
          <arg type="NSString*">domainName</arg>
188
 
          <desc>
189
 
          </desc>
190
 
        </method>
191
 
        <method type="NSArray*">
192
 
          <sel>persistentDomainNames</sel>
193
 
          <desc>
194
 
          </desc>
195
 
        </method>
196
 
        <method type="void">
197
 
          <sel>registerDefaults:</sel>
198
 
          <arg type="NSDictionary*">dictionary</arg>
199
 
          <desc>
200
 
          </desc>
201
 
        </method>
202
 
        <method type="void">
203
 
          <sel>removeObjectForKey:</sel>
204
 
          <arg type="NSString*">defaultName</arg>
205
 
          <desc>
206
 
          </desc>
207
 
        </method>
208
 
        <method type="void">
209
 
          <sel>removePersistentDomainForName:</sel>
210
 
          <arg type="NSString*">domainName</arg>
211
 
          <desc>
212
 
          </desc>
213
 
        </method>
214
 
        <method type="void">
215
 
          <sel>removeVolatileDomainForName:</sel>
216
 
          <arg type="NSString*">domainName</arg>
217
 
          <desc>
218
 
          </desc>
219
 
        </method>
220
 
        <method type="NSArray*">
221
 
          <sel>searchList</sel>
222
 
          <desc>
223
 
          </desc>
224
 
        </method>
225
 
        <method type="void">
226
 
          <sel>setBool:</sel>
227
 
          <arg type="BOOL">value</arg>
228
 
          <sel>forKey:</sel>
229
 
          <arg type="NSString*">defaultName</arg>
230
 
          <desc>
231
 
          </desc>
232
 
        </method>
233
 
        <method type="void">
234
 
          <sel>setFloat:</sel>
235
 
          <arg type="float">value</arg>
236
 
          <sel>forKey:</sel>
237
 
          <arg type="NSString*">defaultName</arg>
238
 
          <desc>
239
 
          </desc>
240
 
        </method>
241
 
        <method type="void">
242
 
          <sel>setInteger:</sel>
243
 
          <arg type="int">value</arg>
244
 
          <sel>forKey:</sel>
245
 
          <arg type="NSString*">defaultName</arg>
246
 
          <desc>
247
 
          </desc>
248
 
        </method>
249
 
        <method type="void">
250
 
          <sel>setObject:</sel>
251
 
          <arg type="id">value</arg>
252
 
          <sel>forKey:</sel>
253
 
          <arg type="NSString*">defaultName</arg>
254
 
          <desc>
255
 
          </desc>
256
 
        </method>
257
 
        <method type="void">
258
 
          <sel>setPersistentDomain:</sel>
259
 
          <arg type="NSDictionary*">domain</arg>
260
 
          <sel>forName:</sel>
261
 
          <arg type="NSString*">domainName</arg>
262
 
          <desc>
263
 
          </desc>
264
 
        </method>
265
 
        <method type="void">
266
 
          <sel>setSearchList:</sel>
267
 
          <arg type="NSArray*">array</arg>
268
 
          <desc>
269
 
          </desc>
270
 
        </method>
271
 
        <method type="void">
272
 
          <sel>setVolatileDomain:</sel>
273
 
          <arg type="NSDictionary*">domain</arg>
274
 
          <sel>forName:</sel>
275
 
          <arg type="NSString*">domainName</arg>
276
 
          <desc>
277
 
          </desc>
278
 
        </method>
279
 
        <method type="NSArray*">
280
 
          <sel>stringArrayForKey:</sel>
281
 
          <arg type="NSString*">defaultName</arg>
282
 
          <desc>
283
 
          </desc>
284
 
        </method>
285
 
        <method type="NSString*">
286
 
          <sel>stringForKey:</sel>
287
 
          <arg type="NSString*">defaultName</arg>
288
 
          <desc>
289
 
          </desc>
290
 
        </method>
291
 
        <method type="BOOL">
292
 
          <sel>synchronize</sel>
293
 
          <desc>
294
 
          </desc>
295
 
        </method>
296
 
        <method type="NSDictionary*">
297
 
          <sel>volatileDomainForName:</sel>
298
 
          <arg type="NSString*">domainName</arg>
299
 
          <desc>
300
 
          </desc>
301
 
        </method>
302
 
        <method type="NSArray*">
303
 
          <sel>volatileDomainNames</sel>
304
 
          <desc>
305
 
          </desc>
306
 
        </method>
307
 
      </class>
308
 
    </chapter>
309
 
  </body>
310
 
</gsdoc>