More iOS issues

Previous topic - Next topic

MrTAToad

Odd - I found I did...  It wouldn't write the data unless an empty file was present to start with.

AlienMenace

Quote from: MrTAToad on 2011-May-13
Ah - the GLB_ON_QUIT thing should have given it away.  First of, make sure that AUTOPAUSE TRUE is used.  It would also be a good idea to check to see if GLB_ON_QUIT is actually being called (its quite possible that its not).

I do have that at the top of my code:

ALLOWESCAPE FALSE
AUTOPAUSE TRUE

Also, I'm pretty sure GLB_ON_QUIT is being called because it writes the file properly on the PC... on the iOS side, who the heck knows. I feel a little like I've been through the wringer with stuff that works properly on the PC side but crashes, doesn't work, etc. on the iOS side. 

Thanks ampos, I'll give that a try next.  :)
Apps published: 3

AlienMenace

#17
I tried ampos' suggestion and it still does not work. Here's my current code:

ALLOWESCAPE FALSE
AUTOPAUSE TRUE
GLOBAL file$

file$=PLATFORMINFO$("DOCUMENTS")+"/test.ini"

INIOPEN file$
   Ffx_mode=INIGET$("Main", "fx_mode")
   Fselect=INIGET$("Main", "select")
   Fvisible=INIGET$("Main", "visible")
   Fcolor=INIGET$("Main", "color")
   Fmute=INIGET$("Main", "mute")

WHILE TRUE

DO STUFF

WEND
END

SUB GLB_ON_QUIT:

   INIOPEN file$
   INIPUT "Main", "fx_mode", Ffx_mode
   INIPUT "Main", "select",Fselect
   INIPUT "Main", "visible", Fvisible
   INIPUT "Main", "color", Fcolor
   INIPUT "Main", "mute", Fmute
   INIOPEN ""

ENDSUB

Checked the console in XCode and it indicates that it cannot locate the file when I try to open it at the beginning. I also added:

STDOUT "on quit\n"

to the beginning of the SUB GLB_ON_QUIT: subroutine and it does not display this in the console when I kill the application. Any
ideas why SUB GLB_ON_QUIT: would not be called on program termination?

I also added a STDOUT to GLB_ON_PAUSE: and GLB_ON_RESUME: and they both work fine.

SUB GLB_ON_QUIT: not being called seems to be the problem allright... I am stopping the app from the iOS side whilest in GLB_ON_PAUSE: (minimized) state, does that make any difference?

Thanks.
Apps published: 3

Slydog

#18
Is the problem that the app is never entering the GLB_ON_QUIT() routine is because the app is not quitting.
You said it *IS* going in to pause mode, which is different than 'quit'.

Pause appears visually the same as quit, as the iPhone gives the user control back to the iPhone interface, but keeps the app in memory in case you want to restart it.  It frees / unloads the app when it needs more memory.  While 'quit' unloads the app from memory immediately.  That's my understanding.

It should trigger one function *OR* the other.

Just call your save code from your 'pause' code, and reload it in the 'resume' code.

I think Gernot added an option to force an app to never pause, but to always quit.
(Is that what the 'AUTOPAUSE' is for?)

(I've never compiled my game for my iPhone yet, so take this advice with a grain of salt, I just read a few forum posts.)
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]