Force Quit - Command

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Tester2
Posts: 102
Joined: Wed May 18, 2011 7:02 pm

Force Quit - Command

Post by Tester2 » Mon Dec 19, 2011 11:45 pm

What command does LiveCode give when the app is force-quit? (ie: double clicking the Home button and "x"ing the app...or restarting your phone)

I need to know this so I can set the file "trackCard".

Thanks bunches!

-Tester2

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: Force Quit - Command

Post by Jellicle » Tue Dec 20, 2011 4:36 am

Try "shutdown".

g
14" MacBook Pro
Former LiveCode developer.
Now recovering.

Tester2
Posts: 102
Joined: Wed May 18, 2011 7:02 pm

Re: Force Quit - Command

Post by Tester2 » Tue Dec 20, 2011 6:34 pm

Hey Gerry,

I tried "shutdown" and this command is triggered when the app is hibernated (ie: pressing the Home button once), but here is my scenario...

I am setting the file "trackCard" to allow my user to re-open the app to the card they were last on. This is the code I have on my stack script for startup:

set the defaultfolder to specialFolderPath("documents")
/* check if there is or is not a file trackCard*/
if there is not a file "trackCard" then
put "Home" into URL "file:trackCard"
end if

if there is a file "trackCard" then
put URL "file:trackCard" into whichCard
go card whichCard
end if

My issue, however, is when the user force-quits" the app. I am wondering if there is a way that the file 'trackCard' gets reset?

Like, say I restart my phone...is there a way to tell this file to clear itself, so that the app opens as if it was the first time the user opened it?

Thanks.

-Tester2

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: Force Quit - Command

Post by Jellicle » Tue Dec 20, 2011 8:52 pm

Not that I can think of, no. Your app is sandboxed and no outside influence or action can touch it's files.

Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.

CALL-151
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 206
Joined: Wed Oct 20, 2010 11:00 am

Re: Force Quit - Command

Post by CALL-151 » Fri Dec 23, 2011 8:00 pm

Hopefully, this problem will go away when Livecode supports multitasking as implemented in iOS. Right now, there's no difference between the two states. As far as your app is concerned, when the user quits your app by pressing the home button, it's the same as if they "force quit". That's why your splash screen appears each time. So technically, the question isn't "how can I tell when the user force quits?", it's "how can I tell when the user doesn't?"

Post Reply