how do I call create a name of a button variable in a code, with a number in it? (hard to explain)
Posted
by Sam Jarman
on Stack Overflow
See other posts from Stack Overflow
or by Sam Jarman
Published on 2010-04-05T04:30:51Z
Indexed on
2010/04/05
4:33 UTC
Read the original article
Hit count: 320
Ive got a int, that is changed in a previous method, that now has to be part of the name of a button variable
eg
int numberFromLastOne;
numberFromLastOne = 4;
I then want to get 'button4' to do something. Could i use something like this?
[[button@"%d", numberFromLastOne] doSomethign:withSomethignElse];
Ive never had to do something this before....
Any ideas would be appreciated :)
Sam
© Stack Overflow or respective owner