This is a bit of a silly question, but if I want to add an object to an array I can do it with both NSMutableArray
and NSArray
, which should I use?
Use NSMutableArray, that is what it is there for. If I was looking at code and I saw NSArray I would expect it's collection to stay constant forever, whereas if I see NSMuteableArray I know that the collection is destined to change.
It might not sound like much right now, but as your project grows and as you spend more time on it you will see the value of this eventually.