Hello,
i have a question about tables and arrays: what the most effective way to clear everything( i.e reset) from table or array? Can anyone show me an example, please?
any help is appreciated
Label: corona android iphone ipad building error inmobi problem display screen View image tableView failed object physics touch button game lua config event listener |
Hello,
i have a question about tables and arrays: what the most effective way to clear everything( i.e reset) from table or array? Can anyone show me an example, please?
any help is appreciated
If you want to clear everything from the table? Use:
t = {}
thanks, although i already have understanding of tables and know how to clear them, but wanted to ask opinions)
I use a for loop to iterate through the table. This only works for tables with a numeric key.
1 2 3 4 5 6 | local table = {} for i=1, #table do table[i]:removeSelf() -- Optional Display Object Removal table[i] = nil -- Nil Out Table Instance end |