Quote:
Originally Posted by roberthuttinger
this makes sense to me. in php you can do a rand(0,10) etc to get a random number between 1 and 10 but what is the syntax for xcode? and concatenating strings so if I generate a random number, how can I take that number to get the equivelent of: "image/imgNum" . $i . ".png"?
is there a 'cheat sheet for how to do these basic things?
|
I have a similar question, how can i call or, create a object name dynamically? Something like this:
Imagine i have this:
for (int i = 0; i < 10; i++) {
[newRecord setNumber'i':@"0"];
}
what is the syntax for this? Or in this case:
for (int i = 0; i < 100; i++) {
[image'i' setAlpha:1];
}
so it can automatically set the alpha to 100 pictuers named image1, image2, image3 etc. ?
thanks =)