How to populate an array of arrays
===

 I need to change an application and now it is based on a vector of vectors.
 After parsing I get a vector, and  according to a bool Show (Yes/No)I have to populate this array. Array obtained:

    categoryArray = [[NSMutableArray arrayWithObjects:[NSMutableArray arrayWithObjects:
    [[[MyLauncherItem alloc] initWithTitle:@"Item 01" image:@"Icon_Category" target:@"ItemViewController"  show:YES] autorelease],
    [[[MyLauncherItem alloc] initWithTitle:@"Item 02" image:@"Icon_Category" target:@"ItemViewController"  show:NO] autorelease], nil], nil] retain];

  My array of arrays must be something like :(this is the structure of actual array in application)

    [addedCategory:[NSMutableArray arrayWithObjects: 
	[NSMutableArray arrayWithObjects: 
    [[[MyLauncherItem alloc] initWithTitle:@"Item 01" image:@"Icon_Category" target:@"ItemViewController"  deletable:YES] autorelease],
                                 nil], 
    [NSMutableArray arrayWithObjects:                               
    [[[MyLauncherItem alloc] initWithTitle:@"Item 13" image:@"Icon_Category" target:@"ItemViewController"  deletable:YES] autorelease],
                                 nil],
    [NSMutableArray arrayWithObjects:    
    [[[MyLauncherItem alloc] initWithTitle:@"Item 25" image:@"Icon_Category" target:@"ItemViewController"  deletable:YES] autorelease],                                                         nil],
                                nil]];

  I wrote this code, but it doesn't work:

        NSMutableArray *pages = [NSMutableArray array];
        // pages = my array of arrays

        NSMutableArray *currentPageArray = [NSMutableArray array];
        int currentPage = 0;
        // addedCategory - array result after parsing with all elements show:YES
        for(int i = 0 ; i < addedCategory.count ; i++)
        {
            int pageToGoTo = i/12; 
           // every array from the big array muyst heve 12 elements  
            
            if (currentPage != pageToGoTo)
            {
                [pages addObject:currentPageArray];
                currentPageArray = [NSMutableArray array]; 
                currentPage = pageToGoTo;
            }
            
            id obj = [addedCategory objectAtIndex:i];
            [currentPageArray addObject:obj];
        }
        
        if(currentPageArray && currentPageArray.count)
            [pages addObject:currentPageArray];

    if(!launcherItems)
	{    
		[launcherView setPages:pages]; 
	}


  Can somebody help me with this method, please ! Thanks in advance !