I am developing an iphone app and I was wondering the following:
How do I initialise an NSMutableArray of NSMutableArrays to a certain size?
Sorry for the noob question
NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:5];
for (int i = 0; i < 5; i++) {
NSMutableArray *innerArray = [[NSMutableArray alloc] initWithCapacity:5];
[array addObject:innerArray];
}
You don't set a maximum size. You just keep addObject:'ing to them