2
<title>NSDictionary</title>
5
<a href ="NSDeserializer.html">[Previous] </a>
6
<a href ="Base.html">[Up] </a>
7
<a href ="NSDirectoryEnumerator.html">[Next] </a>
11
<dt><a href ="http://www.gnustep.org/developers/whoiswho.html">Richard Frith-Macdonald</a>
13
<dt><a href ="http://altern.org/pyhrr">Pierre-Yves Rivaille</a>
16
<p>Version: $Revision: 1.14 $</p>
17
<p>Date: $Date: 2001/12/12 14:10:12 $</p>
18
<h2><a name ="cont-0">NSDictionary</a></h2>
19
<h2><a name ="NSDictionary">NSDictionary</a></h2>
20
<p><b>Declared in: </b> Foundation/NSDictionary.h</p>
21
<p><b>Inherits from: </b> NSObject</p>
22
<p><b>Conforms to: </b> NSCoding, NSCopying, NSMutableCopying
29
<h2>Instance Variables </h2>
34
<li ><a href ="NSDictionary.html#method-0">+allocWithZone:</a>
35
<li ><a href ="NSDictionary.html#method-1">+dictionary</a>
36
<li ><a href ="NSDictionary.html#method-2">+dictionaryWithContentsOfFile:</a>
37
<li ><a href ="NSDictionary.html#method-3">+dictionaryWithDictionary:</a>
38
<li ><a href ="NSDictionary.html#method-4">+dictionaryWithObject:forKey:</a>
39
<li ><a href ="NSDictionary.html#method-5">+dictionaryWithObjects:forKey:</a>
40
<li ><a href ="NSDictionary.html#method-6">+dictionaryWithObjects:forKeys:count:</a>
41
<li ><a href ="NSDictionary.html#method-7">+dictionaryWithObjectsAndKeys:</a>
42
<li ><a href ="NSDictionary.html#method-30">- keysSortedByValueUsingSelector:</a>
43
<li ><a href ="NSDictionary.html#method-8">-allKeys</a>
44
<li ><a href ="NSDictionary.html#method-9">-allKeysForObject:</a>
45
<li ><a href ="NSDictionary.html#method-10">-allValues</a>
46
<li ><a href ="NSDictionary.html#method-11">-count</a>
47
<li ><a href ="NSDictionary.html#method-12">-descriptionInStringsFileFormat</a>
48
<li ><a href ="NSDictionary.html#method-14">-descriptionWithLocale:</a>
49
<li ><a href ="NSDictionary.html#method-13">-descriptionWithLocale:</a>
50
<li ><a href ="NSDictionary.html#method-15">-fileGroupOwnerAccountName</a>
51
<li ><a href ="NSDictionary.html#method-16">-fileModificationDate</a>
52
<li ><a href ="NSDictionary.html#method-17">-fileOwnerAccountName</a>
53
<li ><a href ="NSDictionary.html#method-18">-filePosixPermissions</a>
54
<li ><a href ="NSDictionary.html#method-19">-fileSize</a>
55
<li ><a href ="NSDictionary.html#method-20">-fileSystemFileNumber</a>
56
<li ><a href ="NSDictionary.html#method-21">-fileSystemNumber</a>
57
<li ><a href ="NSDictionary.html#method-22">-fileType</a>
58
<li ><a href ="NSDictionary.html#method-23">-initWithContentsOfFile:</a>
59
<li ><a href ="NSDictionary.html#method-24">-initWithDictionary:</a>
60
<li ><a href ="NSDictionary.html#method-25">-initWithObjects:</a>
61
<li ><a href ="NSDictionary.html#method-26">-initWithObjects:forKeys:count:</a>
62
<li ><a href ="NSDictionary.html#method-27">-initWithObjectsAndKeys:</a>
63
<li ><a href ="NSDictionary.html#method-28">-isEqualToDictionary:</a>
64
<li ><a href ="NSDictionary.html#method-29">-keyEnumerator</a>
65
<li ><a href ="NSDictionary.html#method-31">-objectEnumerator</a>
66
<li ><a href ="NSDictionary.html#method-32">-objectForKey:</a>
67
<li ><a href ="NSDictionary.html#method-33">-objectsForKeys:notFoundMarker:</a>
68
<li ><a href ="NSDictionary.html#method-34">-writeToFile:atomically:</a>
69
<li ><a href ="NSDictionary.html#method-35">-writeToURL:atomically:</a>
71
<hr><h2>Class Methods </h2>
72
<h3><a name ="method-0">allocWithZone:</a></h3>
73
+ (id) <b>allocWithZone:</b> (NSZone*)zone;<br>
77
<h3><a name ="method-1">dictionary</a></h3>
78
+ (id) <b>dictionary</b>;<br>
80
Returns an empty dictionary.
83
<h3><a name ="method-2">dictionaryWithContentsOfFile:</a></h3>
84
+ (id) <b>dictionaryWithContentsOfFile:</b> (NSString*)path;<br>
86
Returns a dictionary using the file located at path.
87
The file must be a property list containing a dictionary as its root object.
90
<h3><a name ="method-3">dictionaryWithDictionary:</a></h3>
91
+ (id) <b>dictionaryWithDictionary:</b> (NSDictionary*)otherDictionary;<br>
93
Returns a newly created dictionary with the keys and objects of otherDictionary.
94
(The keys and objects are not copied.)
97
<h3><a name ="method-4">dictionaryWithObject:forKey:</a></h3>
98
+ (id) <b>dictionaryWithObject:</b> (id)anObject <b>forKey:</b> (id)aKey;<br>
100
Returns a dictionary containing only one object (anObject) which is associated with aKey.
103
<h3><a name ="method-5">dictionaryWithObjects:forKey:</a></h3>
104
+ (id) <b>dictionaryWithObjects:</b> (NSArray*)objects <b>forKey:</b> (NSArray*)keys;<br>
106
Returns a dictionary created using the given objects and keys.
107
The two arrays must have the same size.
108
The n th element of the objects array is associated with the n th element of the keys array.
111
<h3><a name ="method-6">dictionaryWithObjects:forKeys:count:</a></h3>
112
+ (id) <b>dictionaryWithObjects:</b> (id*)objects <b>forKeys:</b> (id*)keys <b>count:</b> (unsigned int)count;<br>
114
Returns a dictionary created using the C arrays objects and keys.
115
The number of elements in both C arrays must be count.
118
<h3><a name ="method-7">dictionaryWithObjectsAndKeys:</a></h3>
119
+ (id) <b>dictionaryWithObjectsAndKeys:</b> (id)object, ...;<br>
121
Returns a dictionary created using the list given as argument.
122
The list is alernately composed of objects and keys.
123
Thus, the list's length must be pair.
126
<hr><h2>Instances Methods </h2>
127
<h3><a name ="method-8">allKeys</a></h3>
128
- (NSArray*) <b>allKeys</b>;<br>
130
Returns an array containing all the dictionary's keys.
133
<h3><a name ="method-9">allKeysForObject:</a></h3>
134
- (NSArray*) <b>allKeysForObject:</b> (id)anObject;<br>
136
Returns an array containing all the dictionary's keys that are associated with anObject.
139
<h3><a name ="method-10">allValues</a></h3>
140
- (NSArray*) <b>allValues</b>;<br>
142
Returns an array containing all the dictionary's objects.
145
<h3><a name ="method-11">count</a></h3>
146
- (unsigned int) <b>count</b>;<br>
148
Returns an unsigned integer which is the number of elements stored in the dictionary.
151
<h3><a name ="method-12">descriptionInStringsFileFormat</a></h3>
152
- (NSString*) <b>descriptionInStringsFileFormat</b>;<br>
157
<h3><a name ="method-13">descriptionWithLocale:</a></h3>
158
- (NSString*) <b>descriptionWithLocale:</b> (NSDictionary*)locale;<br>
163
<h3><a name ="method-14">descriptionWithLocale:</a></h3>
164
- (NSString*) <b>descriptionWithLocale:</b> (NSDictionary*)locale;<br>
169
<h3><a name ="method-15">fileGroupOwnerAccountName</a></h3>
170
- (NSString*) <b>fileGroupOwnerAccountName</b>;<br>
175
<h3><a name ="method-16">fileModificationDate</a></h3>
176
- (NSDate*) <b>fileModificationDate</b>;<br>
181
<h3><a name ="method-17">fileOwnerAccountName</a></h3>
182
- (NSString*) <b>fileOwnerAccountName</b>;<br>
187
<h3><a name ="method-18">filePosixPermissions</a></h3>
188
- (unsigned long) <b>filePosixPermissions</b>;<br>
193
<h3><a name ="method-19">fileSize</a></h3>
194
- (unsigned long long) <b>fileSize</b>;<br>
199
<h3><a name ="method-20">fileSystemFileNumber</a></h3>
200
- (unsigned long) <b>fileSystemFileNumber</b>;<br>
205
<h3><a name ="method-21">fileSystemNumber</a></h3>
206
- (unsigned long) <b>fileSystemNumber</b>;<br>
211
<h3><a name ="method-22">fileType</a></h3>
212
- (NSString*) <b>fileType</b>;<br>
217
<h3><a name ="method-23">initWithContentsOfFile:</a></h3>
218
- (id) <b>initWithContentsOfFile:</b> (NSString*)path;<br>
220
see dictionaryWithContentOfFile:
223
<h3><a name ="method-24">initWithDictionary:</a></h3>
224
- (id) <b>initWithDictionary:</b> (NSDictionary*)otherDictionary;<br>
226
See dictionaryWithDictionary:
229
<h3><a name ="method-25">initWithObjects:</a></h3>
230
- (id) <b>initWithObjects:</b> (NSArray*)objects;<br>
232
See <a href ="#dictionaryWithObjects:">dictionaryWithObjects:</a>
235
<h3><a name ="method-26">initWithObjects:forKeys:count:</a></h3>
236
- (id) <b>initWithObjects:</b> (id*)objects <b>forKeys:</b> (id*)keys <b>count:</b> (unsigned int)count;<br>
238
see dictionaryWithObjects: forKeys: count:
241
<h3><a name ="method-27">initWithObjectsAndKeys:</a></h3>
242
- (id) <b>initWithObjectsAndKeys:</b> (id)object,;<br>
244
see dictionaryWithObjectsAndKeys:
247
<h3><a name ="method-28">isEqualToDictionary:</a></h3>
248
- (BOOL) <b>isEqualToDictionary:</b> (NSDictionary*)otherDictionary;<br>
253
<h3><a name ="method-29">keyEnumerator</a></h3>
254
- (NSEnumerator*) <b>keyEnumerator</b>;<br>
256
Return an enumerator object containing all the keys of the dictionary.
259
<h3><a name ="method-30"> keysSortedByValueUsingSelector:</a></h3>
260
- (NSArray*) <b> keysSortedByValueUsingSelector:</b> (SEL)comparator;<br>
265
<h3><a name ="method-31">objectEnumerator</a></h3>
266
- (NSEnumerator*) <b>objectEnumerator</b>;<br>
268
Return an enumerator object containing all the keys of the dictionary.
271
<h3><a name ="method-32">objectForKey:</a></h3>
272
- (id) <b>objectForKey:</b> (id)aKey;<br>
274
Returns the first object which has aKey as key.
277
<h3><a name ="method-33">objectsForKeys:notFoundMarker:</a></h3>
278
- (NSArray*) <b>objectsForKeys:</b> (NSArray*)keys <b>notFoundMarker:</b> (id)anObject;<br>
283
<h3><a name ="method-34">writeToFile:atomically:</a></h3>
284
- (BOOL) <b>writeToFile:</b> (NSString*)path <b>atomically:</b> (BOOL)flag;<br>
289
<h3><a name ="method-35">writeToURL:atomically:</a></h3>
290
- (BOOL) <b>writeToURL:</b> (NSURL*)url <b>atomically:</b> (BOOL)flag;<br>