Thursday 21 June 2012

creating a two dimensional CGRECT


 create a instance variable

 CGRect  **ippArray;

//note that status is a two dimension 

then in you view did load method

- (void)viewDidLoad
{
    [super viewDidLoad];
    ippArray = malloc( 12 * sizeof( CGRect * ) ); //array pointer to the next dimension
    for(int  i = 0; i < 12; i++ )
    {
        ippArray[ i ] = calloc( 8, sizeof( CGRect ) );

    }
}


The formatting will look like this(roughly) for a 3*2 dimension
Although based on the type of data structure you want you can create any type of memory structure
you want and based on which you can access the elements.


why to go for a texture packer?