I'm using a single action to handle 10 UISwitches by sending a tag value to it. I have a number of integers initialised when launched thus;
int switch_1 = 0; int switch_2 = 0; etc
When a particular switch is switched on, I want to set the integer to the corresponding integer 'variable' with a 1
So, if switch 2 with tag 2 is turned on, it puts a '1' in the corresponding int 'switch_2' as an integer.
I am getting a string with the right name via 'stringWithFormat' by appending the tag value but don't know how to write the 1 to the corresponding integer variable from it.
Any help would be greatly appreciated. Essentially, I want to write an integer to a 'variable' name with the same name as the generated string value.
Thanks