Hi All,
I am slowly getting familiar with Corona but its a painful process so far.
Here is my current dilemma!
I have a app that uses storyboard’s and for the most part it works perfectly fine, however every now and then, when tapping on a tableview, it crashes with :
Bad argument #-2 to 'insert' (Proxy expected, got nil) stack traceback: [C]: ? [C]: in function 'insert' ?: in function '?' ?: in function 'gotoScene' ....browse.lua:226:in function '\_onRowTouch' ?: in function \<?:516\> ?: in function \<?:218\>
Now here is the weird part. This only happens SOMETIMES. most of the time I can click on a table entry, and it will correctly switch to the detail storyboard, and go back and forth without issue. However sometimes as soon as I click or drag the table this error comes up.
Sometimes I will go into an entries details, come back to the browse screen and click the entry again and have this error show up. I have no idea at all what is causing it.
this is my onRowTouch event :
local function onRowTouch( event ) if event then local phase = event.phase local row = event.target local temp = {} temp[1] = listrecs[row.index].company temp[2] = listrecs[row.index].offer temp[3] = listrecs[row.index].address temp[4] = listrecs[row.index].text temp[5] = listrecs[row.index].catagories temp[6] = listrecs[row.index].distance storyboard.detail\_data = temp temp = nil storyboard.previous\_scene = "browse" storyboard.gotoScene( "details" ) return true end end
I did have purgeScene in the ExitScene function of the Browse storyboard, I tried removing it, moving it to details storyboard but to no effect.
the CreateScene of the details storyboard only has one button and 4 text objects placed in scene. no other special or advanced stuff.
The error is really not helpful, can a guru perhaps fill me in on what this error means, and how it could work sometimes?
Finally, I am willing to post all of my code (theres a lot) if you want to see the whole thing
Thankyou all!