Author Topic: Need to get app to close completely when home button is hit  (Read 2750 times)

bous006

  • Guest
Need to get app to close completely when home button is hit
« on: January 22, 2013, 01:42:31 pm »
Hey, I need to figure out a way for my app the close completely whenever the home button is hit(aka not going on the multitasking menu). I also need to figure out how to make it so that my notes cant be edited when touched in the app. Any help would be greatly appreciated, thanks.

glina126

  • Guest
Re: Need to get app to close completely when home button is hit
« Reply #1 on: January 22, 2013, 07:44:13 pm »
Hey, I need to figure out a way for my app the close completely whenever the home button is hit(aka not going on the multitasking menu). I also need to figure out how to make it so that my notes cant be edited when touched in the app. Any help would be greatly appreciated, thanks.

im very curious why you would ever need that? as to the notes. NoteSetEditable???? did you even look at the api?

EricB

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +1/-0
    • View Profile
Re: Need to get app to close completely when home button is hit
« Reply #2 on: January 22, 2013, 09:51:02 pm »
I was looking to the same thing awhile back, having the app close when home button is pressed. The support guys told me that they could do that for me when I was ready for the app store build. Ask them about this.

EricB

bous006

  • Guest
Re: Need to get app to close completely when home button is hit
« Reply #3 on: January 22, 2013, 10:01:35 pm »
Well i am using a random number generator to determine the number of array that gets printed out. there is also a more button to be pressed if you want... well another output to replace the old one. Once the more button is pressed 98 times nothing prints out any more until you completely close the app, thus my need for the app to close completely arises. And yes, ive read the api and ive tried NoteSetEditable but for some reason is hasnt worked, But thank you "EricB" ill look into that.

jousepo

  • Jr. Member
  • **
  • Posts: 75
  • Karma: +0/-0
    • View Profile
Re: Need to get app to close completely when home button is hit
« Reply #4 on: January 23, 2013, 01:21:41 am »
I have tried this one and it works:

Quote
int i=0;
if (1/i);

it's a simulated division by zero error that in ios will close your app without showing any message.


nednones

  • Guest
Re: Need to get app to close completely when home button is hit
« Reply #5 on: January 23, 2013, 07:09:22 am »
This is very bad practice. I suggest you don't this as a.) Apple may reject it as it forces an infinite loop which hogs memory and CPU processing time and b.) you should never terminate an app, let the platform OS do this. Instead, you should be thinking of your app as a state machine. The initial state is when your app starts and loads resources e.t.c. When the home button is hit use InitSuspend() to reset the current state of the app

bous006

  • Guest
Re: Need to get app to close completely when home button is hit
« Reply #6 on: January 23, 2013, 09:02:59 am »
I found a way around having to close the app, but thanks for all the advice and ill keep it in mind.

ciuffolo

  • Guest
Re: Need to get app to close completely when home button is hit
« Reply #7 on: January 23, 2013, 12:52:33 pm »
Close everything when hitted home?
It will stay opened while you don't close it from the background, but you can catch when the home button is pressed, making all the variables to their default.