In the app that I am making, I am using a segmented button to control adding or subtracting a number by one or two, the only problem is that I dont know how to add/subrtact a number by two based on the method that I use to add or subtract by one. This is the code that I have in my app to add or subtract by one:
int number = 0;
-(IBAction)IncrementNumber:(id)sender {
number++;
[currentNumber setText:[NSString stringWithFormat:@"%d", number]];
}
-(IBAction)DecrementNumber:(id)sender {
number--;
[currentNumber setText:[NSString stringWithFormat:@"%d", number]];
}
Based on this code, how would I go twards adding or subtracting by two or even three?
Or more verbal:
(Where n is the number you want to add/substract.)