I wonder if this affects performance or memory consumption a lot. I need an NSMutableArray, and at the beginning I can only guess how many objects will be added. About 3 to 5 maybe. So I create it like this:
NSMutableArray *arr = [[NSMutableArray alloc] initWithCapacity:3];
What happens here exactly, when creating it with a capacity of 3 rather than 50 for example? Would it be a bad idea to create it with capacity of 1, when knowing that there will be at least 20 elements? Or does that not matter enough to take some headaches on it? I have like 10 of these arrays in my app and they all have to load at start.