Figuring out whether the plus or minus button was pressed in UIStepper I use this method:
- (void)stepperOneChanged:(UIStepper*)stepperOne
And I compare stepperOne.value
with a global value saved in my TableView Class.
I dont think this is the right way.
So to clarify, I will show the "bad" code i am using:
- (void)stepperOneChanged:(UIStepper*)stepperOne
{
BOOL PlusButtonPressed=NO;
if(stepperOne.value>globalValue)
{
PlusButtonPressed =YES;
}
globalValue=stepperOne.value;
//do what you need to do with the PlusButtonPressed boolean
}
So what is the right way to do this? (without having to save global variables)