Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

newConvert

macrumors regular
Original poster
Aug 25, 2006
214
3
Hello Everyone,

Fairly new to the iphone dev, so I was hoping someone could help me out... couldn't find anything through a search.

I am making a free app for my friends and I that will keep track of a bunch of scores for various teams/sports that we are interested in... I am trying to make a large grid, for arguments sake 8x8 (64squares) and be able to edit/change the values in each one. IE click in a square and the numberpad pops up.

Any advice? I really can't think of a way to draw the grid. Thanks so much.
 

bboyjayz

macrumors member
Mar 20, 2009
55
0
Maybe you can do i thing like that:
this pice of code take an array of ImageView, and add the imageView on the mainView (here, i build a 5/5 grid). After what, if you want to check if the user push one of the images, you just have to write a touchesBegan method;.
Actually I don't if it's the best way to do this, but i know it works (i'm using it)

CGPoint position;
position.x = 100;
position.y = 200;
for(int i = 0; i<ROW; i++){
for(int j=0; j<COL; j++){
plateau[j] = [self newPieceViewWithImageNamed:mad:"blueSquare.png" atPostion:position];
[plateau[j] setEtat:0];
[self addSubview:plateau[j]];
position.x += 30;
dejaPasser[j] = NO;
}
position.y += 30;
position.x = 100;
}

PS: i've forogot to say that newPieceViewWithImageNamed:mad:"blueSquare.png" atPostion:position] just put the imageView at the position "position" with image named "blueSquare.png"...
 

newConvert

macrumors regular
Original poster
Aug 25, 2006
214
3
Maybe you can do i thing like that:
this pice of code take an array of ImageView, and add the imageView on the mainView (here, i build a 5/5 grid). After what, if you want to check if the user push one of the images, you just have to write a touchesBegan method;.
Actually I don't if it's the best way to do this, but i know it works (i'm using it)

CGPoint position;
position.x = 100;
position.y = 200;
for(int i = 0; i<ROW; i++){
for(int j=0; j<COL; j++){
plateau[j] = [self newPieceViewWithImageNamed:mad:"blueSquare.png" atPostion:position];
[plateau[j] setEtat:0];
[self addSubview:plateau[j]];
position.x += 30;
dejaPasser[j] = NO;
}
position.y += 30;
position.x = 100;
}

PS: i've forogot to say that newPieceViewWithImageNamed:mad:"blueSquare.png" atPostion:position] just put the imageView at the position "position" with image named "blueSquare.png"...


Thanks so much! Going to take a look at that and make sure I know whats going!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.