EDIT: modified to use the less vicious method, kindly provided by Tommy's comment.
You can treat static arrays as pointers and store them in NSValue objects:
[mutableArray addObject:[NSValue valueWithPointer:lvl1]]; ... int* level = [(NSValue*)[mutableArray objectAtIndex:whatever] pointerValue]; int someContainedInt = level[index];
Alternatively, you can wrap each individual array in your own NSData object and save them in a mutable array:
[mutableArray addObject:[NSData dataWithBytes:lvl1 length:sizeof(int) * lengthOfArray]]; ... const int* level = (const int*) [(NSData*) [mutableArray objectAtIndex:whatever] bytes];
I have to agree with Frank C, but why do you need to use a Cocoa array to store these arrays at all? Can't you just treat the whole batch as an array of 2D C? If this is static data, then the dynamic aspects of NSMutableArray seem pretty redundant.
EDIT 2: Using C Arrays
If your level arrays are the same length - name it LEVEL_SIZE - you can build a direct 2D array as follows:
static int levels[][LEVEL_SIZE] = { {1, 2, 3, 4, ...}, {15, 17, 19, 21, ...}, {8, 7, 6, 5, ...} };
Otherwise, you will need to build each array individually, and then connect them later:
static int level1[] = {1, 2, 3, 4, ...}; static int level2[] = {15, 17, 19, 21, ...}; static int level3[] = {8, 7, 6, 5, ...}; ... static int* levels[] = {lvl1, lvl2, lvl3, ...};
In any case, you can align one level as a pointer:
int* level = levels[0]; printf("%d\n", level[1]);
To begin with, you will have the NUM_LEVELS level - in your case 50 - so hold as many 0..49 indices in your mutable array as NSNumber objects:
NSMutableArray* levelIndices = [NSMutableArray arrayWithCapacity:NUM_LEVELS]; for ( int i = 0; i < NUM_LEVELS; ++i ) [levelIndices addObject:[NSNumber numberWithInt:i]];
Use this array to count, retrieve, and delete needs. When you pull out an NSNumber object, use it to index into an array of levels to get the level:
int* level = levels[[someNSNumber intValue]];
Et voila.