Next: arrayWithObjects Up: NSArray Previous: Comparison with Pure C

NSArrays are immutable

As in the case of strings, NSArrays are immutable; you can't change them after creation (this allows the GNUstep NSArray code to use some optimisations which would be impossible otherwise). If you need an array that you can modify, you can use a subclass of NSArray, called NSMutableArray. This happens quite often, so we'll discuss it in some details later on.



Nicola 2002-01-13