i'm building an app in Xcode where there are a 81 textviews in the NIB, each with a sequential name, so box1, box2, box3, box4 etc.
When doing data manipulation i want to be able to use the data in each box to add to an array for example. What i would like to be able to do is put this in a loop, so for example something like:
NSMutableArray *array = [[NSMutableArray alloc] init];
for (int i=1; i<82; i++) {
[array addObject: [Indirect("box" & i).text];
}
Similarly when outputting back to the textviews, i want to be able to loop from the array rather than referring to each textview independently. so something like:
for (int i=1; i<82; i++) {
indirect("box" & i).text = [array objectAtIndex:i];
}
Any ideas? Sorry if this is obvious - fairly new to the game.