A simple, low overhead, ordered container for objects. All
the objects in the container are retained by it. The
container may not contain nil (though
it may contain
[NSNull +null]
).
Returns an autoreleased array from the contents of
aURL. The new array is created using
[NSObject +allocWithZone:]
and initialised using the
-initWithContentsOfURL:
method. See the documentation for those methods for
more detail.
Returns the receiver as a text property list in the
traditional format. See
[NSString -propertyList]
for details. If locale is
nil, no formatting is done, otherwise
entries are formatted according to the
locale, and indented according to
level. Unless locale is
nil, a level of zero indents
items by four spaces, while a level of one
indents them by a tab. The items in the
property list string appear in the same order as
they appear in the receiver.
Enumerate over the specified indexes in the
collection using the given block. The
first argument is the object and the second is the
index in the array. The final argument is a pointer
to a BOOL indicating whether the enumeration should
stop. Setting this to YES will interrupt
the enumeration. The opts argument is a
bitfield. Setting the NSNSEnumerationConcurrent
flag specifies that it is thread-safe. The
NSEnumerationReverse bit specifies
that it should be enumerated in reverse order.
Enumerate over the collection using the given
block. The first argument is the object and the
second is the index in the array. The final argument
is a pointer to a BOOL indicating whether the
enumeration should stop. Setting this to
YES will interrupt the enumeration.
Enumerate over the collection using the given
block. The first argument is the object and the
second is the index in the array. The final argument
is a pointer to a BOOL indicating whether the
enumeration should stop. Setting this to
YES will interrupt the enumeration. The
opts argument is a bitfield. Setting the
NSNSEnumerationConcurrent flag
specifies that it is thread-safe. The
NSEnumerationReverse bit specifies
that it should be enumerated in reverse order.
Returns the first object found in the receiver
(starting at index 0) which is present in the
otherArray as determined by using the
-containsObject:
method.
Returns the index of the first object found in the
receiver which is equal to anObject
(using anObject's
[NSObject -isEqual:]
method). Returns NSNotFound on failure.
Returns the index of the first object found in
aRange of receiver which is equal to
anObject (using anObject's
[NSObject -isEqual:]
method). Returns NSNotFound on failure.
Performs a binary search of the array within the
specified range for the index of an
object equal to obj according to cmp. If
NSBinarySearchingInsertionIndex
is specified, searches for the index at which such an
object should be inserted.
Returns the index of the first object in the
specified range in a collection that matches the
condition specified by the block. The
opts argument is a bitfield. Setting the
NSNSEnumerationConcurrent flag
specifies that it is thread-safe. The
NSEnumerationReverse bit specifies
that it should be enumerated in reverse order.
Returns the index of the first object in the array
that matches the condition specified by the block. The
opts argument is a bitfield. Setting the
NSNSEnumerationConcurrent flag
specifies that it is thread-safe. The
NSEnumerationReverse bit specifies
that it should be enumerated in reverse order.
Returns the indexes of the objects in a collection
that match the condition specified by the block and
are in the range specified by the index set. The
opts argument is a bitfield. Setting the
NSNSEnumerationConcurrent flag
specifies that it is thread-safe. The
NSEnumerationReverse bit specifies
that it should be enumerated in reverse order.
Returns the indexes of the objects in a collection
that match the condition specified by the block. The
opts argument is a bitfield. Setting the
NSNSEnumerationConcurrent flag
specifies that it is thread-safe. The
NSEnumerationReverse bit specifies
that it should be enumerated in reverse order.
In MacOS-X class clusters do not have designated
initialisers, and there is a general rule
that -init
is
treated as the designated initialiser of the
class cluster, but that other intitialisers may not
work s expected an would need to be individually
overridden in any subclass.
GNUstep tries to make it easier to subclass a
class cluster, by making class clusters follow the
same convention as normal classes, so the designated
initialiser is the richest
initialiser. This means that all other
initialisers call the documented designated
initialiser (which calls
-init
only for MacOS-X compatibility), and anyone writing
a subclass only needs to override that one initialiser
in order to have all the other ones work.
For MacOS-X compatibility, you may also need to
override various other initialisers. Exactly
which ones, you will need to determine by trial on
a MacOS-X system... and may vary between releases of
MacOS-X. So to be safe, on MacOS-X you probably
need to re-implement all the class cluster
initialisers you might use in conjunction
with your subclass.
Initialize the receiver with the contents of
array. The order of array is
preserved. If shouldCopy is
YES then the objects are copied rather
than simply retained. Invokes
-initWithObjects:count:
Initialises the array with the contents of
the specified file, which must contain an
array in property-list format.
In GNUstep, the property-list format may be either the
OpenStep format (ASCII data), or the MacOS-X
format (UTF-8 XML data)... this method will
recognise which it is.
If there is a failure to load the file for
any reason, the receiver will be released, the method
will return nil, and a warning may be
logged.
Initialises the array with the contents of
the specified URL, which must contain an array in
property-list format.
In GNUstep, the property-list format may be either the
OpenStep format (ASCII data), or the MacOS-X
format (UTF8 XML data)... this method will
recognise which it is.
If there is a failure to load the URL for any reason,
the receiver will be released, the method will return
nil, and a warning may be logged.
This is a designated initialiser for the class.
Subclasses must override this method.
This should initialize the array with count
(may be zero) objects. Retains each
object placed in the array. Calls
-init
(which does nothing but maintain MacOS-X
compatibility), and needs to be
re-implemented in subclasses in order to
have all other initialisers work.
Returns an enumerator describing the array
sequentially from the first to the last
element. If you use a mutable subclass of
NSArray, you should not modify the array during
enumeration.
Assumes that the receiver is an array of paths, and
returns an array formed by selecting the subset of
those patch matching the specified array of
extensions.
Returns an enumerator describing the array
sequentially from the last to the first
element. If you use a mutable subclass of
NSArray, you should not modify the array during
enumeration.
Returns an autoreleased array in which the objects
are ordered according to a sort with
comparator. This invokes
-sortedArrayUsingFunction:context:hint:
with a nil hint.
Returns an autoreleased array in which the objects
are ordered according to a sort with
comparator, where the
comparator function is passed two objects
to compare, and the context as the third
argument. The hint argument is
currently ignored, and may be nil.
Returns a sorted array using the block to determine
the order of objects. The opts argument is a bitfield.
Setting the NSSortConcurrent flag specifies that it
is thread-safe. The NSSortStable bit specifies that it
should keep equal objects in the same order.
This overrides NSObjects implementation of this
method. This method returns an array of objects
returned by invoking
-valueForKey:
for each item in the receiver, substituting NSNull for
nil. A special case: the key
"count" is not forwarded to each object of the
receiver but returns the number of objects of the
receiver.
Writes the contents of the array to the file
specified by path. The file contents
will be in property-list format... under GNUstep
this is either OpenStep style (ASCII characters
using \U hexadecimal escape sequences for unicode),
or MacOS-X style (XML in the UTF8 character set).
If the useAuxiliaryFile flag is
YES, the file write operation is
atomic... the data is written to a temporary file,
which is then renamed to the actual file name.
If the conversion of data into the correct
property-list format fails or the write
operation fails, the method returns
NO, otherwise it returns
YES.
NB. The fact that the file is in property-list format
does not necessarily mean that it can be used to
reconstruct the array using the
-initWithContentsOfFile:
method. If the original array contains
non-property-list objects, the
descriptions of those objects will have been
written, and reading in the file as a
property-list will result in a new array
containing the string descriptions.
Writes the contents of the array to the specified
url. This functions just like
-writeToFile:atomically:
except that the output may be written to any URL,
not just a local file.
This is a designated initialiser for the class.
Subclasses must override this method.
Initialise the array with the specified capacity
... this should ensure that the array can have
numItems added efficiently. Calls
-init
(which does nothing but maintain MacOS-X
compatibility), and needs to be
re-implemented in subclasses in order to
have all other initialisers work.
Inserts an object into the receiver at the
specified location. Raises an exception if
given an array index which is too large.
The size of the array increases by one.
The object is retained by the array.
Inserts the values from the objects
array into the receiver at the locations given by the
indexes set. The values are
inserted in the same order that they appear in the
array.
Removes an object from the receiver at the
specified location. The size of the array
decreases by one. Raises an exception if
given an array index which is too large.
Supplied with a C array of indices
containing count values, this method
removes all corresponding objects from the
receiver. The objects are removed in such a way
that the removal is safe irrespective of the
order in which they are specified in the
indices array.
Places an object into the receiver at the specified
location. Raises an exception if given an
array index which is too large. The
object is retained by the array.
Set method called by the compiler with array
subscripting. Replaces the object at
anIndex or, if anIndex is the
length of the array, this method appends abObject to
the array.