0

Basically what I am trying to do is:

1) The user sets the number of choices he wants e.g. 3 choices which are "A", "B", "C" [Done this]

2) The next view is loaded and the right amount of boxes are created, 3 in this case. The boxes need to be blank at first and then the user enters their choices into the boxes. e.g. "A", "B", "C"

Note: I tried create multiple text boxes automatically, but I found that after about 6 boxes the screen wouldn't scroll and therefore looked very tacky

3)At a click of a button, one of the textboxes is selected randomly. The inputed data from this randomly selected box is then displayed in NSLog or Label or file, which i will then use in another view.

Thanks

Dan

Dan
  • 21
  • 2
  • 3

1 Answers1

0

Hey, you could make a scrollView out of the 2th view. That way, you can still automatically create textfields, and the screen will scroll. Check out this link for more information on how to create a scrollview. Perhaps you can make the scrollview's size dynamically (depending on how much textfields you have).

About selecting a random textfield, use arc4random() More about that can be found here.

Community
  • 1
  • 1
Joetjah
  • 6,292
  • 8
  • 55
  • 90