I have a bunch of buttons named:
button1
button2
button3
etc.
Is there a way to basically do this?
pseudocode
for(int i = 1, i < 15, i++) {
button{i}.selected = YES;
}
This also goes for method calls, etc. I've often thought such a way of calling methods would be very convenient, but I don't think I've ever seen it done when using compiled languages. But I have done it using PHP.
Is there any way to do this in Objective-C? (That's where my problem is now, but I'd also be interested in if you can do this in other languages.) Alternately, is there a reason why this is NOT a good way to go about accessing all the UI elements?
Thanks!