I’m trying to remove a file if user exit aplication or suspend her
but only works in simulator… in my iphone it did’nt work…
function onSystemEvent( event )
if "applicationSuspend" == event.type or "applicationExit" == event.type then
local destDir = system.DocumentsDirectory -- where the file is stored
local results, reason = os.remove( system.pathForFile( "noticias.xml", destDir ) )
if results then
print( "file removed" )
else
print( "file does not exist", reason )
end
end
end
Runtime:addEventListener( "system", onSystemEvent )
if I lock my iphone or simples press the menu button, the file still there
but in simulator, the file are deleted… anyone can help me? [import]uid: 23063 topic_id: 16469 reply_id: 316469[/import]
[import]uid: 12482 topic_id: 16469 reply_id: 61540[/import]