I am developing an iphone application and I was interested in the following:
How to initialize NSMutableArray from NSMutableArrays to a specific 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 do not set a maximum size. You just save addObject: 'ing to them