Hello!
I’m using the example code from the table view widget and when I use the code below, I get the following error:
Corona Simulator Runtime error
File: ?
Attempt to compare number with string
stack traceback:
?: in function <?:512>
?: in function <?:218>
The only difference between my code and the example code is that I added the tableView widget. What gives?
tableView = widget.newTableView{ top = 0, height = "300" } -- Insert 40 rows for i = 1, 40 do local isCategory = false local rowHeight = 36 local rowColor = { default={ 1, 1, 1 }, over={ 1, 0.5, 0, 0.2 } } local lineColor = { 0.5, 0.5, 0.5 } -- Make some rows categories if ( i == 1 or i == 21 ) then isCategory = true rowHeight = 40 rowColor = { default={ 0.8, 0.8, 0.8, 0.8 } } lineColor = { 1, 0, 0 } end -- Insert a row into the tableView tableView:insertRow( { isCategory = isCategory, rowHeight = rowHeight, rowColor = rowColor, lineColor = lineColor, params = {} -- Include custom data in the row } ) end