0

I'm using a UIStepper which I added through the storyboard. I had a IBOulet reference to my UITableViewCell subclass and a IBAction when the stepper's value changed.

My problem is that when I touch my UIStepper, there is no animation. I'm quite new in iOS dev so I can't find out why.

There is my header file:

//CellSubclass.h
@interface SAProductCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIStepper *quantityStepper;
- (IBAction)stepperValueChanged:(id)sender;

And my implementation:

//CellSubclass.m
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString*)reuseIdentifier
{
   self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
   if (self) {
       self.quantityStepper.minimumValue = 0;
       self.quantityStepper.stepValue = 0;
       self.quantityStepper.value = 1;
   }
   return self;
}
// ...
- (IBAction)stepperValueChanged:(id)sender{
    self.quantity = [[NSNumber alloc] initWithDouble:([self.quantityStepper value])] ;
    //[self refreshUI]; --> WORKS FINE !! But there is no animation when I touch down my stepper
}
jszumski
  • 7,430
  • 11
  • 40
  • 53
Benjamin Ellis
  • 171
  • 1
  • 7
  • add some of your code – Tommy Devoy May 02 '13 at 16:53
  • Please provide additional information, such as the function that is called when the stepper is tapped, etc. Your question is currently very vague and it's hard for anyone to know the cause of your issue. – Stunner May 02 '13 at 16:54
  • code added as you asked – Benjamin Ellis May 02 '13 at 17:09
  • What animation are you expecting? `UIStepper` doesn’t have any animation. Do you mean the control doesn’t darken when you touch down on it? – Zev Eisenberg May 02 '13 at 19:56
  • By the way, you can probably do `self.quantity = @(self.quantityStepper.value);`. The new [literals syntax](http://www.mikeash.com/pyblog/friday-qa-2012-06-22-objective-c-literals.html) is perfect for that kind of thing. – Zev Eisenberg May 02 '13 at 19:58

0 Answers0