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

« back to all changes in this revision

Viewing changes to Documentation/gsdoc/NSArray.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>NSArray</title>
3
 
</head>
4
 
<body>
5
 
<a href ="NSArchiver.html">[Previous] </a>
6
 
<a href ="Base.html">[Up] </a>
7
 
<a href ="NSAssertionHandler.html">[Next] </a>
8
 
<h1>NSArray</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
 
<dt><a href ="">Pierre-Yves Rivaille</a>
14
 
<dd>
15
 
</dl>
16
 
<p>Version: $Revision: 1.13 $</p>
17
 
<p>Date: $Date: 2001/12/12 14:10:12 $</p>
18
 
<h2><a name ="cont-0">NSArray</a></h2>
19
 
<h2><a name ="NSArray">NSArray</a></h2>
20
 
<p><b>Declared in: </b> Foundation/NSArray.h</p>
21
 
<p><b>Inherits from: </b> NSObject</p>
22
 
<p><b>Conforms to: </b> NSCoding
23
 
</p>
24
 
<hr>
25
 
 
26
 
          
27
 
<h2>Instance Variables </h2>
28
 
<ul>
29
 
</ul>
30
 
<h2>Methods </h2>
31
 
<ul>
32
 
<li ><a href ="NSArray.html#method-0">+allocWithZone:</a>
33
 
<li ><a href ="NSArray.html#method-1">+array</a>
34
 
<li ><a href ="NSArray.html#method-2">+arrayWithArray:</a>
35
 
<li ><a href ="NSArray.html#method-3">+arrayWithContentsOfFile:</a>
36
 
<li ><a href ="NSArray.html#method-4">+arrayWithObject:</a>
37
 
<li ><a href ="NSArray.html#method-5">+arrayWithObjects:</a>
38
 
<li ><a href ="NSArray.html#method-6">+arrayWithObjects:count:</a>
39
 
<li ><a href ="NSArray.html#method-7">-arrayByAddingObject:</a>
40
 
<li ><a href ="NSArray.html#method-8">-arrayByAddingObjectsFromArray:</a>
41
 
<li ><a href ="NSArray.html#method-9">-componentsJoinedByString:</a>
42
 
<li ><a href ="NSArray.html#method-10">-containsObject:</a>
43
 
<li ><a href ="NSArray.html#method-11">-count</a>
44
 
<li ><a href ="NSArray.html#method-12">-descriptionWithLocale:</a>
45
 
<li ><a href ="NSArray.html#method-13">-descriptionWithLocale:</a>
46
 
<li ><a href ="NSArray.html#method-14">-firstObjectCommonWithArray:</a>
47
 
<li ><a href ="NSArray.html#method-15">-getObjects:</a>
48
 
<li ><a href ="NSArray.html#method-16">-getObjects:range:</a>
49
 
<li ><a href ="NSArray.html#method-17">-indexOfObject:</a>
50
 
<li ><a href ="NSArray.html#method-18">-indexOfObject:range:</a>
51
 
<li ><a href ="NSArray.html#method-19">-indexOfObjectIdenticalTo:</a>
52
 
<li ><a href ="NSArray.html#method-20">-indexOfObjectIdenticalTo:range:</a>
53
 
<li ><a href ="NSArray.html#method-21">-initWithArray:</a>
54
 
<li ><a href ="NSArray.html#method-22">-initWithContentsOfFile:</a>
55
 
<li ><a href ="NSArray.html#method-23">-initWithObjects:</a>
56
 
<li ><a href ="NSArray.html#method-24">-initWithObjects:count:</a>
57
 
<li ><a href ="NSArray.html#method-25">-isEqualToArray:</a>
58
 
<li ><a href ="NSArray.html#method-26">-lastObject</a>
59
 
<li ><a href ="NSArray.html#method-27">-makeObjectsPerformSelector:</a>
60
 
<li ><a href ="NSArray.html#method-28">-makeObjectsPerformSelector:withObject:</a>
61
 
<li ><a href ="NSArray.html#method-29">-objectAtIndex:</a>
62
 
<li ><a href ="NSArray.html#method-30">-objectEnumerator</a>
63
 
<li ><a href ="NSArray.html#method-31">-pathsMatchingExtensions:</a>
64
 
<li ><a href ="NSArray.html#method-32">-reverseObjectEnumerator</a>
65
 
<li ><a href ="NSArray.html#method-33">-sortedArrayHint</a>
66
 
<li ><a href ="NSArray.html#method-34">-sortedArrayUsingFunction:context:</a>
67
 
<li ><a href ="NSArray.html#method-35">-sortedArrayUsingFunction:context:</a>
68
 
<li ><a href ="NSArray.html#method-36">-sortedArrayUsingSelector:hint:</a>
69
 
<li ><a href ="NSArray.html#method-37">-subarrayWithRange:</a>
70
 
<li ><a href ="NSArray.html#method-38">-writeToFile:atomically:</a>
71
 
<li ><a href ="NSArray.html#method-39">-writeToURL:atomically:</a>
72
 
</ul>
73
 
<hr><h2>Class Methods </h2>
74
 
<h3><a name ="method-0">allocWithZone:</a></h3>
75
 
+ (id) <b>allocWithZone:</b> (NSZone*)zone;<br>
76
 
 
77
 
          TODO
78
 
          
79
 
 <hr>
80
 
<h3><a name ="method-1">array</a></h3>
81
 
+ (id) <b>array</b>;<br>
82
 
 
83
 
            Returns a new empty array.
84
 
          
85
 
 <hr>
86
 
<h3><a name ="method-2">arrayWithArray:</a></h3>
87
 
+ (id) <b>arrayWithArray:</b> (NSArray*)anArray;<br>
88
 
 
89
 
            Returns a new array containing the same elements as anArray.
90
 
          
91
 
 <hr>
92
 
<h3><a name ="method-3">arrayWithContentsOfFile:</a></h3>
93
 
+ (id) <b>arrayWithContentsOfFile:</b> (NSString*)aPath;<br>
94
 
 
95
 
            Returns a new array based upon the file located at aPath. 
96
 
            This file may be in property list format or in XML format (if XML is available).
97
 
            This method returns nil if the file does not represent an array.
98
 
          
99
 
 <hr>
100
 
<h3><a name ="method-4">arrayWithObject:</a></h3>
101
 
+ (id) <b>arrayWithObject:</b> (id)anObject;<br>
102
 
 
103
 
            Returns a new array containing only one object, anObject.
104
 
          
105
 
 <hr>
106
 
<h3><a name ="method-5">arrayWithObjects:</a></h3>
107
 
+ (id) <b>arrayWithObjects:</b> (id)firstObj,;<br>
108
 
 
109
 
            Returns a new array containing the objects passed as arguments to the method. The order is preserved.
110
 
          
111
 
 <hr>
112
 
<h3><a name ="method-6">arrayWithObjects:count:</a></h3>
113
 
+ (id) <b>arrayWithObjects:</b> (id*)objects <b>count:</b> (unsigned)count;<br>
114
 
 
115
 
            Returns a new array containing the objects that are in 
116
 
            the C-array objects and which size is count.
117
 
            The order is preserved.
118
 
          
119
 
 <hr>
120
 
<hr><h2>Instances Methods </h2>
121
 
<h3><a name ="method-7">arrayByAddingObject:</a></h3>
122
 
- (NSArray*) <b>arrayByAddingObject:</b> (id)anObject;<br>
123
 
 
124
 
            Returns a new array created by adding anObject at the end of seld. The order is respected.
125
 
          
126
 
 <hr>
127
 
<h3><a name ="method-8">arrayByAddingObjectsFromArray:</a></h3>
128
 
- (NSArray*) <b>arrayByAddingObjectsFromArray:</b> (NSArray*)otherArray;<br>
129
 
 
130
 
            Returns a new array which is the concatenation of self and otherArray (in this precise order).
131
 
          
132
 
 <hr>
133
 
<h3><a name ="method-9">componentsJoinedByString:</a></h3>
134
 
- (NSString*) <b>componentsJoinedByString:</b> (NSString*)separator;<br>
135
 
 
136
 
            Returns a string created by the concatenation of self's elements' description separated by the string separator.
137
 
            The order is preserved.
138
 
          
139
 
 <hr>
140
 
<h3><a name ="method-10">containsObject:</a></h3>
141
 
- (BOOL) <b>containsObject:</b> (id)anObject;<br>
142
 
 
143
 
            Returns YES if anObject belongs to self. No otherwise. The isEqual: method of anObject is used to test equality.
144
 
          
145
 
 <hr>
146
 
<h3><a name ="method-11">count</a></h3>
147
 
- (unsigned int) <b>count</b>;<br>
148
 
 
149
 
            Returns the number of elements contained in self.
150
 
          
151
 
 <hr>
152
 
<h3><a name ="method-12">descriptionWithLocale:</a></h3>
153
 
- (NSString*) <b>descriptionWithLocale:</b> (NSDictionary*)locale;<br>
154
 
 
155
 
            TODO
156
 
          
157
 
 <hr>
158
 
<h3><a name ="method-13">descriptionWithLocale:</a></h3>
159
 
- (NSString*) <b>descriptionWithLocale:</b> (NSDictionary*)locale;<br>
160
 
 
161
 
            TODO
162
 
          
163
 
 <hr>
164
 
<h3><a name ="method-14">firstObjectCommonWithArray:</a></h3>
165
 
- (id) <b>firstObjectCommonWithArray:</b> (NSArray*)otherArray;<br>
166
 
 
167
 
            Returns the first element of the array which can be found in otherArray.
168
 
            Equality is tested with the isEqual method.
169
 
          
170
 
 <hr>
171
 
<h3><a name ="method-15">getObjects:</a></h3>
172
 
- (void) <b>getObjects:</b> (id*)aBuffer;<br>
173
 
 
174
 
            This methods store all the elements of self inside aBuffer which is a C-array.
175
 
            The order is preserved. You should get sure aBuffer's size is sufficient.
176
 
          
177
 
 <hr>
178
 
<h3><a name ="method-16">getObjects:range:</a></h3>
179
 
- (void) <b>getObjects:</b> (id*)aBuffer <b>range:</b> (NSRange)aRange;<br>
180
 
 
181
 
            This methods store the elements of self in the range aRange inside aBuffer which is a C-array.
182
 
            The order is preserved. You should get sure aBuffer's size is sufficient.            
183
 
          
184
 
 <hr>
185
 
<h3><a name ="method-17">indexOfObject:</a></h3>
186
 
- (unsigned int) <b>indexOfObject:</b> (id)anObject;<br>
187
 
 
188
 
            Returns the index of the first object of the array which is equal to anObject.
189
 
            Equality is tested with the isEqual: method of anObject.
190
 
          
191
 
 <hr>
192
 
<h3><a name ="method-18">indexOfObject:range:</a></h3>
193
 
- (unsigned int) <b>indexOfObject:</b> (id)anObject <b>range:</b> (NSRange)aRange;<br>
194
 
 
195
 
            Returns the index of the first object of the array which is equal to anObject and which is in aRange range.
196
 
            Equality is tested with the isEqual: method of anObject.            
197
 
          
198
 
 <hr>
199
 
<h3><a name ="method-19">indexOfObjectIdenticalTo:</a></h3>
200
 
- (unsigned int) <b>indexOfObjectIdenticalTo:</b> (id)anObject;<br>
201
 
 
202
 
            Returns the index of the first object of the array which is physically equal to anObject.
203
 
            Physical equality is tested with ==. 
204
 
          
205
 
 <hr>
206
 
<h3><a name ="method-20">indexOfObjectIdenticalTo:range:</a></h3>
207
 
- (unsigned int) <b>indexOfObjectIdenticalTo:</b> (id)anObject <b>range:</b> (NSRange)aRange;<br>
208
 
 
209
 
            Returns the index of the first object of the array which is physically equal to anObject and which is in aRange range.
210
 
            Physical equality is tested with ==. 
211
 
          
212
 
 <hr>
213
 
<h3><a name ="method-21">initWithArray:</a></h3>
214
 
- (id) <b>initWithArray:</b> (NSArray*)anArray;<br>
215
 
 
216
 
            Initialize the array with the content of anArray. The order is preserved.
217
 
            Returns self.
218
 
          
219
 
 <hr>
220
 
<h3><a name ="method-22">initWithContentsOfFile:</a></h3>
221
 
- (id) <b>initWithContentsOfFile:</b> (NSString*)aPath;<br>
222
 
 
223
 
            Initialize the array based upon the file located at aPath. 
224
 
            This file may be in property list format or in XML format (if XML is available).
225
 
            If the file does not represent an array, self is left uninitialized and nil is returned.
226
 
            Otherwise self is returned.
227
 
          
228
 
 <hr>
229
 
<h3><a name ="method-23">initWithObjects:</a></h3>
230
 
- (id) <b>initWithObjects:</b> (id)firstObj,;<br>
231
 
 
232
 
            Initialize the array with the objects passed as arguments. The order is preserved.
233
 
            Returns self.
234
 
            NSInvalidArgumentException is raised if nil is one of the objects.
235
 
          
236
 
 <hr>
237
 
<h3><a name ="method-24">initWithObjects:count:</a></h3>
238
 
- (id) <b>initWithObjects:</b> (id*)objects <b>count:</b> (unsigned)count;<br>
239
 
 
240
 
            Initialize the array with the objects contained in the 
241
 
               C-array argument which size is count.
242
 
            The order is preserved.
243
 
            Returns self.
244
 
            NSInvalidArgumentException is raised if nil is one of the objects.
245
 
          
246
 
 <hr>
247
 
<h3><a name ="method-25">isEqualToArray:</a></h3>
248
 
- (BOOL) <b>isEqualToArray:</b> (NSArray*)otherArray;<br>
249
 
 
250
 
            Returns YES if the two arrays contain the same elements,
251
 
            i.e. the two arrays have the same length and <br>
252
 
            for i from 0 to length - 1,
253
 
            [[self objectAtIndex: i] isEqual: [anArray objectAtIndex: i]] returns YES.
254
 
          
255
 
 <hr>
256
 
<h3><a name ="method-26">lastObject</a></h3>
257
 
- (id) <b>lastObject</b>;<br>
258
 
 
259
 
            Returns the last element of the array. If the array is empty, returns nil.
260
 
          
261
 
 <hr>
262
 
<h3><a name ="method-27">makeObjectsPerformSelector:</a></h3>
263
 
- (void) <b>makeObjectsPerformSelector:</b> (SEL)aSelector;<br>
264
 
 
265
 
            Perform aSelector on every object of the array.
266
 
            This is done sequentially from the last to the first object.
267
 
          
268
 
 <hr>
269
 
<h3><a name ="method-28">makeObjectsPerformSelector:withObject:</a></h3>
270
 
- (void) <b>makeObjectsPerformSelector:</b> (SEL)aSelector <b>withObject:</b> (id)anObject;<br>
271
 
 
272
 
            Perform aSelector with the argument anObject on every object of the array.
273
 
            This is done sequentially from the last to the first object.
274
 
          
275
 
 <hr>
276
 
<h3><a name ="method-29">objectAtIndex:</a></h3>
277
 
- (id) <b>objectAtIndex:</b> (unsigned int)index;<br>
278
 
 
279
 
            Returns located in the array at position index.
280
 
            Raise NSRangeException if index is out of bounds
281
 
          
282
 
 <hr>
283
 
<h3><a name ="method-30">objectEnumerator</a></h3>
284
 
- (NSEnumerator*) <b>objectEnumerator</b>;<br>
285
 
 
286
 
            Returns an enumerator describing the array sequentially 
287
 
              from the first to the last element.<br>
288
 
            If you use a mutable subclass of NSArray, 
289
 
              you should not modify the array during enumeration
290
 
          
291
 
 <hr>
292
 
<h3><a name ="method-31">pathsMatchingExtensions:</a></h3>
293
 
- (NSArray*) <b>pathsMatchingExtensions:</b> (NSArray*)filterTypes;<br>
294
 
 
295
 
            Returns all the elements of the array which are NSString which 
296
 
            extensions are within the filterTypes NSArray.
297
 
          
298
 
 <hr>
299
 
<h3><a name ="method-32">reverseObjectEnumerator</a></h3>
300
 
- (NSEnumerator*) <b>reverseObjectEnumerator</b>;<br>
301
 
 
302
 
            Returns an enumerator describing the array sequentially 
303
 
              from the last to the first element.<br>
304
 
            If you use a mutable subclass of NSArray, 
305
 
              you should not modify the array during enumeration
306
 
 
307
 
          
308
 
 <hr>
309
 
<h3><a name ="method-33">sortedArrayHint</a></h3>
310
 
- (NSData*) <b>sortedArrayHint</b>;<br>
311
 
 
312
 
             Returns nil. Does not do anything. TODO
313
 
          
314
 
 <hr>
315
 
<h3><a name ="method-34">sortedArrayUsingFunction:context:</a></h3>
316
 
- (NSArray*) <b>sortedArrayUsingFunction:</b> (int(*)(id,id,void*))comparator <b>context:</b> (void*)context;<br>
317
 
 
318
 
            TODO
319
 
          
320
 
 <hr>
321
 
<h3><a name ="method-35">sortedArrayUsingFunction:context:</a></h3>
322
 
- (NSArray*) <b>sortedArrayUsingFunction:</b> (int(*)(id,id,void*))compare <b>context:</b> (void*)context;<br>
323
 
 
324
 
            TODO
325
 
          
326
 
 <hr>
327
 
<h3><a name ="method-36">sortedArrayUsingSelector:hint:</a></h3>
328
 
- (NSArray*) <b>sortedArrayUsingSelector:</b> (SEL)comparator <b>hint:</b> (NSDate*)hint;<br>
329
 
 
330
 
            TODO
331
 
          
332
 
 <hr>
333
 
<h3><a name ="method-37">subarrayWithRange:</a></h3>
334
 
- (NSArray*) <b>subarrayWithRange:</b> (NSRange)range;<br>
335
 
 
336
 
            Returns a new array which contains self's elements located in range.
337
 
            The order is preserved.
338
 
          
339
 
 <hr>
340
 
<h3><a name ="method-38">writeToFile:atomically:</a></h3>
341
 
- (BOOL) <b>writeToFile:</b> (NSString*)path <b>atomically:</b> (BOOL)flag;<br>
342
 
 
343
 
            TODO
344
 
          
345
 
 <hr>
346
 
<h3><a name ="method-39">writeToURL:atomically:</a></h3>
347
 
- (BOOL) <b>writeToURL:</b> (NSURL*)url <b>atomically:</b> (BOOL)flag;<br>
348
 
 
349
 
            TODO
350
 
          
351
 
 <hr>
352
 
</body>
353
 
 
354
 
 </html>