Hello folks,
Is it possible to have a long list of bools in an array and then cycle trough those in an switch statement? Or should I use a directory? (These two things I know nothing about).
basically I have 6 BOOL's and what I do now is:
isEnabled1 = YES;
isEnabled2 = NO;
....
isEnabled6 = NO;
(only one can be enabled at any given time)
so to use these in my app I do
if (isEnabled1 == YES)
do this;
if (isEnabled2 == YES)
do that;
but I would like to make it into a switch statement just because it looks nicer.
switch (myBOOLs)
case isEnabled1
break;
case isEnabled2
break;
.....
is this possible? I played with it yesterday for a bit but did not get it to work (due to my lack of understanding of arrays and nsdirectory).. haven't had time to read up on these yet.
Thanks for any input on the matter
Is it possible to have a long list of bools in an array and then cycle trough those in an switch statement? Or should I use a directory? (These two things I know nothing about).
basically I have 6 BOOL's and what I do now is:
isEnabled1 = YES;
isEnabled2 = NO;
....
isEnabled6 = NO;
(only one can be enabled at any given time)
so to use these in my app I do
if (isEnabled1 == YES)
do this;
if (isEnabled2 == YES)
do that;
but I would like to make it into a switch statement just because it looks nicer.
switch (myBOOLs)
case isEnabled1
break;
case isEnabled2
break;
.....
is this possible? I played with it yesterday for a bit but did not get it to work (due to my lack of understanding of arrays and nsdirectory).. haven't had time to read up on these yet.
Thanks for any input on the matter