我在图像阵列中有一系列图像,
UIImageView *dot[6][4];
我用一种方法将图像放在屏幕上,然后我用另一种方法更改图像,但是我不工作?
-(void)methodA{
for (int x = 0; x<6; x++) {
for (int y=0; y<4; y++) {
dot[x][y] = [[[UIImageView alloc] initWithFrame:CGRectMake(((side+padding)*x)+23, ((-(side+padding))*y)+247, side, side)] autorelease];
dot[x][y].image = [UIImage imageNamed:@"off.png"];
if ((x==0 && y==2) || (x==0 && y==3) || (x==2 && y==3) || (x==4 && y==3)) {
}else{
[self.view addSubview:dot[x][y]];
}
}
}
-(void)methodB:(int)x Y:(int)y{
dot[x][y].image = [UIImage imageNamed:@"on.png"];
}