0

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 1

0

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.