Hi guys,
I’m coding an app in Corona for the first time. When I change between scenes in my tabBar widget with 5 views, the local content (a parsed XML message table) from my view1.lua isn’t removed - that is the display objects are still displayed in view2.lua
This problem seems basic, but nonetheless I’m not sure about the coding I’ve made in my view1.lua regarding the scene closing:
_-- Called when scene is about to move offscreen:
function scene:exitScene( event )
local sceneGroup = self.view
print(“lol”)
storyboard.purgeScene( “scene” )
scene.removeScene()
storyboard.removeAll()
– INSERT code here (e.g. stop timers, remove listenets, unload sounds, etc.)
end
– If scene’s view is removed, scene:destroyScene() will be called just prior to:
function scene:destroyScene( event )
local sceneGroup = self.view
print(“lol”)
– INSERT code here (e.g. remove listeners, remove widgets, save state variables, etc.)
end_
It seems like the the above scene functions aren’t even called eventhough I’ve set the correct (?) eventlisteners. The print(“lol”) doesn’t show up in the terminal, instead it prints “nil” when I change from view1.lua to view2.lua (not the other way round).
All codes and files for my app, which is able to run in the simulator, are attached in the uploaded zip file.
Best regards,
Michael