I am building an iphone game. I have a set of NSStrings that I set periodically throughout the game life cycle. I am finding that I am in need of setting the same NSStrings often and looping through an array of NSStrings is ok for checking the value of the NSStrings atIndex:i, but setting them using the same method results in nothing. Basically I have a set of vars below that I'd like to set in a loop instead. Can someone show me how to re-write the following as a loop that will set the NSStrings properly?:
// reset state to first
square_01State = @"first";
square_02State = @"first";
square_03State = @"first";
square_04State = @"first";
square_05State = @"first";
square_06State = @"first";
square_07State = @"first";
square_08State = @"first";
square_09State = @"first";
square_10State = @"first";
square_11State = @"first";
square_12State = @"first";
square_13State = @"first";
square_14State = @"first";
square_15State = @"first";
square_16State = @"first";
There could potentially be hundreds of these, so I'd like to be able to set them all in a loop. Thanks,