1

I just wanted to ask a question about iPhone development using Apple's XCode. I am new to this but have a background in web development.

What I want is to create a grid kind of like a checkers board about 10 x 10 squares. And then when a user clicks on of those squares i will need to identify it with when they then click the submit turn button.

What would be the best way to go about creating a grid?

I had looked at the table control but it appears that doesn't support rows with multiple columns, tho I could be wrong, let me know if I am.

I also have considered using a UIWebView and just drawing out a table with HTML, but I'm not sure how I could track clicks on the grid.

I'm just after some advice to help me get going down the right route.

Erik B
  • 40,889
  • 25
  • 119
  • 135
Robert
  • 11
  • 2

2 Answers2

0

You can map the touch position in a single UIView to a square. You know the width of the view, you know the height of the view, so a tiny bit of math could do it.

The UITouch class provides a locationInView: method to give you the coordinates of the touch.

Nick Weaver
  • 47,228
  • 12
  • 98
  • 108
0

I think the easiest way to accomplish what you're after is to simply use UIButtons. Align them as a grid and when the user clicks on one you store which one he/she clicked in a variable.

Erik B
  • 40,889
  • 25
  • 119
  • 135