I read about the limit of 200 local variables so I realized I was getting close to the limit. But is the limit a “limit” to each lua file or the entire app?
Also, I started grouping my variables in each scene like below but I’m a bit confused about the removing?
local uiStuff = {}
local sounds = {}
function scene:createScene( event )
local group = self.view
-- background
uiStuff[1] = newRect(group,0, 0, 320, 480 )
-- navbar
uiStuff[2] = newRect(group,0, 20, 320, 44 )
-- etc.......
end
-- fast forward......... :)
function scene:destroyScene( event )
-- this gives an error in the console.
uiStuff[i]:removeSelf()
uiStuff[i] = nil
end
Once every 5-10 searches I get this error, it does not crash my app but the strange thing is I don’t even call any setTextColor() on my text objects?
Runtime error
?:0: attempt to call method 'setTextColor' (a nil value)
stack traceback:
[C]: in function 'setTextColor'
?: in function <?:3>
?: in function <?:229>
Last question…
where do I call storyboard.purgeScene() and storyboard.removeScene( )? [import]uid: 65840 topic_id: 35863 reply_id: 335863[/import]