textfield value increase or decrease by clicking button

- (IBAction)productLessClicked:(id)sender {
if ([self.productTF.text isEqualToString:@"0"]) {

}else{
NSInteger count = self.productTF.text.integerValue;
--count;
self.productTF.text=[NSString stringWithFormat: @"%ld", (long)count];
}
}
- (IBAction)productAddClicked:(id)sender {
NSInteger count = self.productTF.text.integerValue;
++count;

self.productTF.text=[NSString stringWithFormat: @"%ld", (long)count];
}
Previous
Next Post »