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

« back to all changes in this revision

Viewing changes to Documentation/gsdoc/NSUserDefaults.html

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