As above. Would be helpful to know. Thanks!
The primary difference between NSArray and NSMutableArray is that a mutable array can be changed/modified after it has been allocated and initialized, whereas an immutable array, NSArray , cannot.
The NSMutableArray 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 NSArray .
An object representing a static ordered collection, for use instead of an Array constant in cases that require reference semantics.
Here are two options:
- (NSMutableArray *)createMutableArray1:(NSArray *)array { return [NSMutableArray arrayWithArray:array]; } - (NSMutableArray *)createMutableArray2:(NSArray *)array { return [[array mutableCopy] autorelease]; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With