0

I have a UIStepper set up via IB. It increases and decreases the 'label number' on my view. I'm trying to make a button which when the user presses, will reset the number and UIStepper to zero.

How can I do that?

Thanks.

K.Honda
  • 3,106
  • 5
  • 26
  • 37
  • 1
    Make a IBOutlet and link it to that stepper, then use whatever method the stepper has to set it to 0 on the press of a button. – EmilioPelaez Apr 15 '12 at 16:02
  • Sorry, I'm not sure what to do. I have made a 'reset button' on IB. I can make that to reset the label to 0 but when I press the stepper again, the label will continue from where it was before I pressed the 'reset button'. Is there a bit of code where it will reset the label and stepper? Thanks. – K.Honda Apr 15 '12 at 16:26
  • 1
    This is a very simple problem, I pointed you in the right direction, if it's not enough for you to fix it, then you haven't fully understood how this works, and you should focus on that instead, – EmilioPelaez Apr 15 '12 at 16:34

1 Answers1

5

you just need to add this to your button method

yourStepper.value=0;
yourlabel.text=@"0";
EagerMike
  • 2,032
  • 1
  • 24
  • 40