I'll have to work with millions of representations stored as indexes in multiple NSArray objects or NSMutableArray objects. Which one of these classes takes up the least memory?
1 Answer
I don't think there's a significant difference between these two classes in terms of consumed memory. Anyway this is not something you should be concerned with. You use NSMutableArray only when you need to modify your collection. When you don't you use NSArray. Usually NSMutableArray should be some local object copied from a NSArray property. Then you perform some modifications, insert or delete objects and when you are done you copy the modified array back to your readonly NSArray property. That's it. Don't waste your time thinking about how much memory is occupied by one or another class