NSMutable class declares the programmatic interface to objects that manage a modifiable array of objects. This class adds insertion and deletion operations to the basic array-handling behavior inherited from
Accessing Values Using Subscripting
In addition to the provided instance methods, such as
replace, you can access
NSArray values by their indexes using subscripting.
There is typically little reason to subclass
NSMutable. The class does well what it is designed to do—maintain a mutable, ordered collection of objects. But there are situations where a custom
NSArray object might come in handy. Here are a few possibilities:
NSMutablestores the elements of its collection. You might do this for performance reasons or for better compatibility with legacy code.
Acquiring more information about what is happening to the collection (for example, statistics gathering).