You can simply return your NSMutableArray directly:
- (NSArray *)method { return myMutableArray; }
NSMutableArray is a subclass of NSArray , so controllers will be able to perform all NSArray operations on it already. If you are really worried that someone might be trying to impose tricks on you, you can use:
return [NSArray arrayWithArray:myMutableArray];
to return an immutable copy.
source share