Page 1 of 1
iOS app restarting instead of resuming
Posted: Mon Jan 30, 2012 12:13 am
by mousou2003@yahoo.com
Hello,
I have done a small app that run on iOS using LiveCode 5.0.2, XCode 4.2 on OSX Snow Leopard.
The app works great! But, when I switch app back and forth on My iPad (iOS 5.0.1) the App is restarting. I would expect the app to resume to the same state.
Does anyone understand why this is happening?
Re: iOS app restarting instead of resuming
Posted: Mon Jan 30, 2012 11:15 am
by Mark
Hi,
I would expect that too, but RunRev decided otherwise. I believe that reason is that LiveCode apps crash on resume.
Kind regards,
Mark
Re: iOS app restarting instead of resuming
Posted: Mon Jan 30, 2012 1:35 pm
by gpb01
Quite easy to implement ...
... just save somewhere your program environment '
on shutDown' and restore when your program start
Guglielmo
Re: iOS app restarting instead of resuming
Posted: Mon Jan 30, 2012 2:02 pm
by Mark
Hi Guglielmo,
I agree partly. The problem is that 1) it would be so much easier if LiveCode did this by itself and 2) sometimes the user might want to restart the app but there wouldn't be any different between a "resume" and an actual restart.
Kind regards,
Mark
Re: iOS app restarting instead of resuming
Posted: Mon Jan 30, 2012 2:52 pm
by gpb01
Mark wrote:Hi Guglielmo,
I agree partly. The problem is that 1) it would be so much easier if LiveCode did this by itself and 2) sometimes the user might want to restart the app but there wouldn't be any different between a "resume" and an actual restart.
Kind regards,
Mark
Hi Mark,
I totally agree on point (1)

, but I don't understand your point (2) ...
...if you want a 'resume' situation, just save where exactly you are and, when the program restart, you go where you have been stopped, otherwise, just 'restart' and discard the saved situation.
Guglielmo
Re: iOS app restarting instead of resuming
Posted: Mon Jan 30, 2012 3:01 pm
by Mark
Hi Guglielmo,
There is no way for the app (or the programmer) to know whether the app restarts because the user wants it to "resume" or because the user wants it to actually restart.
In other words, there is no way to know whether the user double-pressed the Home button and navigated to a different app or double-pressed the Home button, tapped-and-held the app icon until the delete badge appeared and tapped the delete badge to stop the app and then started the app again from the Home screen.
Kind regards,
Mark
Re: iOS app restarting instead of resuming
Posted: Mon Jan 30, 2012 3:22 pm
by gpb01
Mark wrote:Hi Guglielmo,
There is no way for the app (or the programmer) to know whether the app restarts because the user wants it to "resume" or because the user wants it to actually restart.
In other words, there is no way to know whether the user double-pressed the Home button and navigated to a different app or double-pressed the Home button, tapped-and-held the app icon until the delete badge appeared and tapped the delete badge to stop the app and then started the app again from the Home screen.
Kind regards,
Mark
Hi Mark,
... ok, now I understand what you mean ... and yes, you right, unfortunately there is no way to know ...
Regards,
Guglielmo
Re: iOS app restarting instead of resuming
Posted: Tue Jan 31, 2012 5:11 am
by mousou2003@yahoo.com
Is this behavior compliant with Apple guidelines? There is a big document on Apple web site that tells you what is expected - and honestly I did not read all.
I wouldn't want my App to be rejected.
Re: iOS app restarting instead of resuming
Posted: Tue Jan 31, 2012 5:52 pm
by Mark
Hi,
It is not a reason to reject your app.
Kind regards,
Mark
Re: iOS app restarting instead of resuming
Posted: Tue Aug 14, 2012 2:19 am
by semiplay
If anyone is interested, I have found a solution that works in the simulator for iOS so far.
I looked at the specialFolderPath info, and both temp and cache seem to stick around only for the duration of the app. The effect is that if I use the home button to leave the app, then come back, it goes to the card I was on. If I double click and actually quit the app from the bottom menu, then start it again, it starts on card 1.
Hopefully it's helpful.
==============================================
--Here is what I added to the main stack script:
on openStack
set the defaultFolder to specialFolderPath("cache")
put URL ("file:iphonetest.txt") into myCard
if myCard is not empty then
go card myCard
end if
end openStack
on shutdown
set the defaultFolder to specialFolderPath("cache")
put the number of the current card into URL ("file:iphonetest.txt")
end shutdown