I don't understand exactly what the brickArray is referring to. Code to create an array of int values looks like this (again, I think... very rusty on C and new to Obj-C)
Code:
int brickLayout[8][8] = {
{0,0,0,0,0,0,0,0},
{1,1,0,0,0,0,1,1},
{1,0,1,0,0,1,0,1},
{1,0,2,0,0,2,0,1},
{1,0,2,0,0,2,0,1},
{1,0,1,0,0,1,0,1},
{1,1,0,0,0,0,1,1},
{1,1,3,1,1,3,1,1}
};
Then you index into the array by using your i value in the same way you assigned the position.
Code:
int thisBrickValue = brickLayout[i%8][i/8];
Though you may have to switch the values if things start to look funky. Or it may be perfectly fine, just kinda strange to me because I'm used to row major ordered arrays and not column major ordered.
Using the value you get from the array you can then use a switch statement to create the correct image.
Code:
switch(thisBrickValue) {
case 1:
brick = [[UIImageView alloc] initWithImage:[UIImage imageNamed:[NSString stringWithFormat:@"yellow.png"]]];
break;
case 2:
brick = [[UIImageView alloc] initWithImage:[UIImage imageNamed:[NSString stringWithFormat:@"blue.png"]]];
break;
//ECT ECT ECT
default:
NSLog(@"ERROR!!!");
}
Hope this code helps you to get it up and running, if not just reply and I'll try to help some more.