In my app, there is a TableView that any row of it contains a title and a “delete” btn, which I want to show and hide when clicking “Edit” button. That’s works fine, but when I remove a row and then “hiding” the Delete button. there is an error that goes like this:
attempt to index field '?' (a nil value) stack traceback: ?:in function \<?:296\> (tail call):? recipiesList.lua:30: in function '\_onRelease' ?: in function '?' ?: in function \<?:424\> ?: in function \<?:218\>
This is the code that remove the delete buttons:
[lua]local numRows = listTableView:getNumRows( )
print( “numRows:”, numRows )
for i=1, numRows do
local row = listTableView:getRowAtIndex( i )
print( “row:”, row.params.title )
if row and (not row.isCategory) then
transition.to( row.deleteBtn, { x = -20 } )
transition.to( row.rowTitle, { x = 0 } )
end
end[/lua]
Any Help?