Hi
I want to cycle through an array table and display some of the contents (it’s actually a page of scores).
This is the gist of what I have:
for i = 1, #myTable do local myText = display.newText(myGroup, myTable[i].myField, 100, 100 \* i, FONT\_NAME, 30 ) ... end
and then later in another function:
myGroup:removeSelf()
The question I have around this is that I wind up with 8 text objects on the screen, but there has only ever been one variable name. It works just fine on my test devices (iOS 7 iPads and Asus tablet) and the simulator but I’m wondering whether it’s sloppy code. Should I be dynamically generating a new variable name each time through the loop, based on the value of “i” ?
thanks,
David