Possible Duplicate:
Objective C Equivalent of PHP’s “Variable Variables”
Today in one of my classes I learned you can access a variable by building its name from a string in Actionscript 3.0, like so:
var star1:symbol;
var star2:symbol;
var star3:symbol;
var star4:symbol;
for(i=1; i <= 4; i++)
[this "star" + i].method = something
This gets star1
, then star2
, then star3
, then star4
, and does some method with them.
Is there a way to do something like this in Objective-C?