Say I have a UITextField (default blank), a UISegmentedControl (default 2 segments named "1" & "2"), and a UILabel (default text "None") in my nib. I want to be able to do the following:
- I want to enter a number in the UITextField, say "3"
- I then want to redraw the UISegmentedControl to have 3 segments named "1", "2", and "3."
- I then want to select the segment in the UISegmentedControl, and reflect the selection in the UILabel. So if I select "3", UILabel will show "3"
I know how to set an IBAction that will catch the number entered in the UITextField, but how do #2 above, that is how do I "redraw" the UISegmentControl to have 3 segments named "1", "2", and "3?"
I know how to do #3.