Reputation: 3192
If you have an array you're going to completely repopulate many times during an applications lifetime, would it be better memory-consumption/allocation-wise to...
removeAllObjects
on the existing instance to repopulateUpvotes: 0
Views: 41
Reputation: 318804
As is typical with such a broad question, the answer is "it depends".
The better answer is, "don't worry about it". Seriously, this is called premature optimization. Unless you run into a real memory issue, either approach will result in negligible differences.
Upvotes: 2