After finding out whether the plus or minus button was pressed in UIStepper, I use this method:
- (void)stepperOneChanged:(UIStepper*)stepperOne
And I compare the value of stepperOne.value with the global value stored in my TableView class.
I do not think this is the right way.
So, to clarify, I will show the "bad" code that I use:
- (void)stepperOneChanged:(UIStepper*)stepperOne
{
BOOL PlusButtonPressed=NO;
if(stepperOne.value>globalValue)
{
PlusButtonPressed =YES;
}
globalValue=stepperOne.value;
}
So what is the right way to do this? (without saving global variables)
source
share