TableView::GetRowAtIndex returns nil for valid rows.
Here’s sample code
local widget = require( "widget" ) -- hide device status bar display.setStatusBar( display.HiddenStatusBar ) function onRowRender(event) local t = nil if (event.row.params == nil) then t = event.target.categoryName else t = "" .. event.row.params.text end local myText = display.newText( event.row, t, 100, 10, native.systemFont, 16 ) myText:setFillColor( 1, 0, 0 ) end local tableView = widget.newTableView { left = 0, top = 20, height = display.contentHeight, width = display.contentWidth, onRowRender = onRowRender, onRowTouch = onRowTouch, listener = scrollListener, noLines = true } -- 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 } tableView.categoryName = "Category " .. i -- Make some rows categories if ( i % 10 == 0 ) 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 = { text = "Row" .. i } } ) end for i = 1, 40 do local rowAtIndex = tableView:getRowAtIndex( i ) if (rowAtIndex == nil) then local totalRows = tableView:getNumRows() print ("Bug. Row at index " .. i .. " shouldn't be nil. Total Rows = " .. totalRows) end end