I have an app that behaves good in most cases, but in the special case of being run the very first time after a clean install on a device it crashes in a call to the reloadData() method of a newTableView() object:
I/Corona ( 8723): /Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/widget/widgetLibrary/widget\_tableview.lua:1595: attempt to index field '?' (a nil value) I/Corona ( 8723): stack traceback: I/Corona ( 8723): /Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/widget/widgetLibrary/widget\_tableview.lua:1595: in function \</Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/widget/widgetLibrary/widget\_tableview.lua:1580\> I/Corona ( 8723): (tail call): ? I/Corona ( 8723): ?: in function 'method' I/Corona ( 8723): /Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:253: in function 'dispatchEvent' I/Corona ( 8723): /Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/composer/composer.lua:886: in function \</Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/composer/composer.lua:865\> I/Corona ( 8723): (tail call): ? I/Corona ( 8723): /Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/transition/transition.lua:588: in function 'method' I/Corona ( 8723): /Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lu
Now, as far as I know what (ther misnamed?) reloadData() method does is to re-render the visible rows of a table (http://docs.coronalabs.com/api/type/TableViewWidget/reloadData.html).
So according to my logic calling reloadData() would lead to a immediate call to the specified onRowRender() function (one call per visible row).
But this is not what happens. I’ve put print statements inside the onRowRender() function and the crash happens even before this function is called once.
So I’m out of options as I have no idea what causes the crash. My guess is that there is something wrong with the newTableView object itseld, but how do I check this (it’s not nil, that’s the only think I’m sure of).