Yeah! That works. I had something similar but just couldn’t get the [j]'s and [i]'s on the same page.
However, it had one major bug left which I just figured out. Nothing wrong with your code example, but something for anybody listening that wants to use widget.newTableView()
-
Using the above code you would now have newTable{}. But you can’t tap anything without having an onRelease=command entry in each table ID!
-
Okay, so I’ll just add the onRelease entry. Sorry! if you do this:
onRelease = PressingtheButton
…The table generator will just fill in nil as the entry. This means you need to have your onRelease function defined first. This is a problem, particularly because if you’re developing anything on the iPad, that function NEEDs to know the table is there first. (I tried declaring the table first but that didn’t seem to be enough.)
- To get past these conflicting problems, you need to use this order:
a. Define the table
b. Define the onRelease function
c. Inject the onRelease entry into the table.
Example:
for i=1,table.maxn(newTable) do
newTable[i].onRelease = PressingtheButton
end
Using table.maxn() is crucial , because if you just declare a number instead, it will go ahead and make extra table entries up to that number, each one only including onRelease…which is enough to crash widget.newTableView()
Thanks again, renvis! [import]uid: 41884 topic_id: 13769 reply_id: 50695[/import]