i haven't had time to test it but this should work:
Code:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
CGPoint touchPosition = [touch locationInView:self.view];
CGFloat cellHeight = 20;
CGFloat cellWidth = 20;
int amountCellsWidth = 50;
int amountCellsHeight = 50;
for (int x=0; x<amountCellsWidth; x++) {
for (int y=0; y<amountCellsHeight; y++) {
if (touchPosition.y > y*cellHeight && touchPosition.y < (y+1)*cellHeight && touchPosition.x > x*cellWidth && touchPosition.x < (x+1)*cellWidth) {
[cell[x][y] setImage:yourImage];
}
}
}
}