Does this error mean that the SECOND argument to ‘insert’ is nil?
.../Data1/iDev/Corona Projs/TOT/TOTscreenController.lua:184: bad argument #-2 to 'insert' (Proxy expected, got nil)
This is really strange because I can print the object that is the second argument and it shows that the second argument IS NOT nil:
‘buttonsGroup’ was created with display.newGroup()
‘buttonsGroupInd’ holds the integer 1
‘rotatedPiecePanel’ is a table which holds display objects:
local buttonsGroup = display.newGroup()
local buttonsGroupInd = 1
local rotatedPiecePanel = {}
local button = display.newImage("TheButton")
button.id = "But1-1"
button.rotIndex = 1
rotatedPiecePanel[1] = button
print("Will Install: ".. rotatedPiecePanel[1].id .."; rotInd is ".. rotatedPiecePanel[1].rotIndex)
buttonsGroup:insert(buttonsGroupInd, rotatedPiecePanel[1])
The above code outputs this to the console:
Will Install: But1-1; rotInd is 1
Runtime error
.../Data1/iDev/Corona Projs/TOT/TOTscreenController.lua:184: bad argument #-2 to 'insert' (Proxy expected, got nil)
Another strange thing is that the first time the above code is executed there is no error. The error occurs the second time it is executed. [import]uid: 295 topic_id: 1708 reply_id: 301708[/import]