[Resolved] Corona Please help, TableView and Storyboard Eroor

My first application, TableView widget gives me an error and sometimes it shows and sometimes it dosnt just give me empty scene i can send the Code to check and the error is :

Runtime error
?:0: attempt to index field ‘target’ (a nil value)
stack traceback:
[C]: ?
?: in function ‘listener’
?: in function ‘?’
?: in function <?:1177>
?: in function <?:218>

Please help

Thank you
Ramy [import]uid: 129462 topic_id: 25689 reply_id: 325689[/import]

I really need this help [import]uid: 129462 topic_id: 25689 reply_id: 103861[/import]

@ramyxcode, don’t take this wrong, but you posted this on a Sunday at 11:05am and then followed up with a 2nd plee 10 minutes later.

Most of the folks at Ansca are hopefully enjoying a well deserved weekend day off.

Secondly you’ve given us (the community) and Ansca almost no information to go on. How about posting the code in the forum post? Make sure to wrap it in <code> and </code> tags. Then maybe someone in the community would be willing to look for you.

If you need Ansca’s help directly, visit this page and purchase the level of support you need: http://www.anscamobile.com/corona/support/

[import]uid: 19626 topic_id: 25689 reply_id: 103876[/import]

As Rob said, if you post up some code we can help you better :slight_smile: [import]uid: 84637 topic_id: 25689 reply_id: 103884[/import]

I have same problem in my code
My code is here

main.lua

local storyboard = require( "storyboard" )  
  
storyboard.gotoScene( "title" )  

title.lua

local storyboard = require( "storyboard" )  
local widget = require( "widget" )  
  
local scene = storyboard.newScene()  
  
function scene:createScene( event )  
 local screenGroup = self.view   
  
 -- TableView  
 local listOptions = {  
 width = 320,  
 height = 480,  
 }  
  
 local list = widget.newTableView( listOptions )  
  
 local function onRowTouch( event )  
 local row = event.target  
 local rowGroup = event.view  
  
 if event.phase == "press" then  
 rowGroup.alpha = 0.5  
 elseif event.phase == "release" then  
 row.reRender = true  
 if event.index == 1 then  
 storyboard.gotoScene( "reading" )  
 else  
 print( "Touch" .. event.index )  
 end  
 end  
  
 return true  
 end  
 local function onRowRender( event )  
 local row = event.target  
 local rowGroup = event.view  
  
 local text = display.newText( event.index, 46, 0, native.systemFont, 14 )  
 text:setTextColor( 51, 51, 51 )  
 text.y = row.height \* 0.5  
  
 rowGroup:insert( text )  
 end  
  
 for i = 1, 10 do  
 local rowHeight, rowColor, lineColor = 61, { 237, 241, 247 }, { 208, 211, 214 }  
 list:insertRow{  
 height = rowHeight,  
 onEvent = onRowTouch,  
 onRender = onRowRender,  
 rowColor = rowColor,  
 lineColor = lineColor,  
 }  
 end  
  
 screenGroup:insert(list)  
end  
  
function scene:enterScene( event )  
 local lastScene = storyboard.getPrevious()  
 if(lastScene) then   
 storyboard.purgeScene( lastScene )  
 end  
end  
  
function scene:exitScene( event )  
  
end  
  
function scene:destroyScene( event )  
  
end  
  
scene:addEventListener( "createScene", scene )  
scene:addEventListener( "enterScene", scene )  
scene:addEventListener( "exitScene", scene )  
scene:addEventListener( "destroyScene", scene )  
  
return scene  

reading.lua

local storyboard = require( "storyboard" )  
  
local scene = storyboard.newScene()  
  
function scene:createScene( event )  
 local screenGroup = self.view   
  
 local text = display.newText(screenGroup, "reading", 100, 100, native.systemFont, 18)  
end  
  
function scene:enterScene( event )  
 local lastScene = storyboard.getPrevious()  
 if(lastScene) then   
 storyboard.purgeScene( lastScene )  
 end  
end  
  
function scene:exitScene( event )  
  
end  
  
function scene:destroyScene( event )  
  
end  
  
scene:addEventListener( "createScene", scene )  
scene:addEventListener( "enterScene", scene )  
scene:addEventListener( "exitScene", scene )  
scene:addEventListener( "destroyScene", scene )  
  
return scene  

CoronaSDK Build:2012.821

If there is anything missing, please let me know.

Thank you [import]uid: 126556 topic_id: 25689 reply_id: 108526[/import]

@devkiyo: I tested your code on daily build 828 and couldn’t reproduce the issue, can you try updating to daily build 828 and see if it fixes it for you also?

Thanks [import]uid: 84637 topic_id: 25689 reply_id: 110488[/import]

Hi Danny

I confirmed my code problem got fixed on build 828.

Thanks [import]uid: 126556 topic_id: 25689 reply_id: 110582[/import]