Objective - c - an array of NSMutableArray arrays

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

+4
source share
2 answers
NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:5]; for (int i = 0; i < 5; i++) { NSMutableArray *innerArray = [[NSMutableArray alloc] initWithCapacity:5]; [array addObject:innerArray]; } 
+9
source

You do not set a maximum size. You just save addObject: 'ing to them

+3
source

All Articles