Incredibly frustrating

I’m finding the build inconsistencies very hard to work with.

A - not all Corona features are compatible with Corona’s own simulator
B - my app runs fine in the corona simulator (so long as I stick with supported features), but not at all on IOS Sim
C - Inconsistent results on my own iPhone 4. The app runs first time, then subsequent times it crashes

It’s entirely possible that the above are caused by code issues. However, unless Corona provides a single testing platform that provides us with consistent (real world) results and features I may end up spending twice the amount of time I need to just to troubleshoot my code.

That’s not something I want to do. Rather than pushing more features out the door, get your sim stable and representative of a real device (or just use xcode sim) and ensure new features are testable. [import]uid: 31718 topic_id: 6971 reply_id: 306971[/import]

This happened to me too — I am using the Director class to switch between screens.

I forgot not to cleanup or use “removeSelf()” on any object you add to the localGroup using Director class.

As when you use “director:changeScene” it will handle all the cleanup of your objects that you added.

So, remove any removeSelf() clean up code that you may of added and give it a try.

I hope this helps you.

Best regards,
Scott [import]uid: 10965 topic_id: 6971 reply_id: 24422[/import]

If the app works the first time, but then crashes the next it looks like your problem might be related to this:

http://developer.anscamobile.com/forum/2010/10/07/tutorial-fixing-ios4-multi-tasking-attempt-crashes

I agree it should be much better documented. [import]uid: 10835 topic_id: 6971 reply_id: 24427[/import]

Thanks for the responses…very helpful.

Ended up being my use of capitalisationInMyVariables

…this seems to go against decades of programming history. Has anybody else come across this?

mycodeisnowveryunreadable.wtf() [import]uid: 31718 topic_id: 6971 reply_id: 24623[/import]

Huh? you can use capitalisation in variables? I do it all the time.

You may have had a typo. I use this code for debug (top of main lua). Since Lua makes any new variable you didnt declare a global, there’s no way to catch typos in variable names.

With this it will error if you try to use a variable without declaring it first.

Only vaveat is all globals will fail. Instead declare them with the declare() function thats included.

declare(“Levels”, {})

^^ this delcares a new global Levels which is preset to {}

Personally I have this at the top of ever project with my global declares right under it. For production i comment out the lot (including those delcares using the multiline lua comment --[[and]]–

Hope it helps!

[code]

function declare (name, initval)
rawset(_G, name, initval or false)
end

setmetatable(_G, {
__newindex = function(_ENV, var, val)
if var ~= “tableDict” then
error((“attempt to set undeclared global”%s""):format(tostring(var)), 2)
else
rawset(_ENV, var, val)
end
end,
__index = function(_ENV, var, val)
if var ~= “tableDict” then
error((“attempt to read undeclared global”%s""):format(tostring(var)), 2)
else
rawset(_ENV, var, val)
end
end,
})

declare(“Levels”,{})
declare(“BonusLevels”,{})

[/code] [import]uid: 8872 topic_id: 6971 reply_id: 25026[/import]

This is very useful, thank you. The strange thing I had was that my app works perfectly in the corona simulator, but not on the device or xcode sim. If I removed capitalization it works on all - or at least that seemed to get it working. I’ll look into this and put some code together to demonstrate. [import]uid: 31718 topic_id: 6971 reply_id: 25032[/import]

Hello,

Does anyone know what the tableDict variable is? Is it a reserved global in Lua or something?

Thanks in advance,
M.Y. Developers [import]uid: 55057 topic_id: 6971 reply_id: 86339[/import]