I’m building a scene with composer that has a tableview in it.
Creating the tableview goes with no problem, but when I try to insert it into the sceneGroup, the app crashes with an error:
ERROR: table expected. If this is a function call, you might have used '.' instead of ':'
Here is my code, called inside scene:create():
-- create tableview local tableView = widget.newTableView( { left = 0, top = 0, width = display.actualContentWidth, height = display.actualContentHeight, onRowRender = onRowRender, onRowTouch = onRowTouch, listener = scrollListener }) -- Insert 40 rows for i = 1, 40 do local isCategory = false local rowHeight = 150 local rowColor = { default={1,1,1}, over={1,0.5,0,0.2} } local lineColor = { 0.5, 0.5, 0.5 } -- Insert a row into the tableView tableView:insertRow( { isCategory = false, rowHeight = rowHeight, rowColor = rowColor, lineColor = lineColor } ) end sceneGroup:insert(tableview) -- \<--APP CRASHES HERE