I was getting ?:0: attempt to call a string value on iPad every time I got a memory warning, and eventually my app crash after having low memory.
After searching endlessy on my code, every line for where I might be calling a string, I tried a new thing…
I added this to main.lua:
local memorybutton = display.newText("ISSUE MEMORY WARNING!", 0, 0, native.systemFontBold, 35);
memorybutton.x = display.contentCenterX;
memorybutton.y = 30;
memorybutton:setTextColor ( 255, 0, 0 );
local function memoryButtonToFront()
memorybutton:toFront();
end
local function issueMemoryWarning( event )
if event.phase == "ended" then
Runtime:dispatchEvent( { name="memoryWarning"} );
end
end
memorybutton:addEventListener( "touch", issueMemoryWarning );
timer.performWithDelay( 500, memoryButtonToFront, 0 );
Then I kept clicking on this button as the game run…
Then I noticed, that after a couple of scene changed (I am using storyboard) I start to get:
“?:0: attempt to call a string value”
every time I click the button… Even on the simulator.
Thus it dawned to me that ?:0: was NOT because it was my own faulty code on the device… ?:0: is because it is Corona own code that is broken, not my code.
So please fix that, because this is causing some very severe crashes (Sometimes it cause device-wide crashes, more than one user reported my application crashing EVERYTHING in the device, and when I reproduced the crash on my own devices, this now dreaded error to me (?:0: attempt to call a string value on Memory Warning) happened some time before the crash. [import]uid: 142895 topic_id: 30302 reply_id: 330302[/import]