I noticed that when I suspend and resume my app my app crashes with no immediately obvious console error giving me a clue. This is iOS. This only happens when I fairly quickly resume after 1 - 3 seconds or so. After 3 seconds or so, then my app doesn’t resume - it actually restarts.
Turns out that I am spending way too many cycles saving state when I suspend my app. Ouch! It never occurred to me before that I have a limited amount of time to save state before the OS pulls the plug. Whoops!
I have 68 ‘chunks of data’ to save in event.type == “applicationSuspend”
When I output some debug to the console my: for i = 1, #chunk do loop
the loop terminates at i = 56 and not 68.
I just wanted to point this out as I’ve never encountered this problem before. No doubt many of you are saving state in “applicationSuspend”… Hopefully you are saving all you think you are saving…
Meantime, I’ll have to think of a solution to my particular problem of spending too much time in my function to save state and the OS pulling the rug after 56 chunks saved and not the entire 68 chunks…!
https://docs.coronalabs.com/api/event/system/type.html warning about it here…