1

I'm programming a quiz for the iPad and when the user presses the homebutton while in a quiz and relaunches the app I want the quiz to be already cancled and back on the Startpage of the app. Now it simply gets back to the last view it was on.

Also I want it to show the splashscreen again when the app relaunches.

A complete reset of the app, when pressing the homebutton, would be great.

Thanks in advance

Joe Doyle
  • 6,363
  • 3
  • 42
  • 45
oybcs
  • 327
  • 1
  • 4
  • 14

2 Answers2

2

So, you want to disable multitasking?

Set UIApplicationExitsOnSuspend = YES in your info.plist.

Unless you just want them to resume through the screen, in which case you'll want to look into the lifecycle callbacks for your AppDelegate.

Josh
  • 12,448
  • 10
  • 74
  • 118
  • Hi, thanks for the hint. Thats exactly what I've been searching for. I simply set "Application does not run in background" to YES – oybcs Apr 29 '12 at 16:40
  • This approach is very discouraged by Apple. It may be a reason for rejection if you don't have very convincing reasons. – Kaan Dedeoglu Apr 29 '12 at 16:46
  • Do you have a source for such claims? – Liam George Betsworth Apr 29 '12 at 16:48
  • I saw a discussion about it. And this is from the Apple iOS manuals, although they don't imply rejection, here it is: "Even though opting out of background execution is strongly discouraged, it may be preferable under certain conditions. Specifically, if coding for the background requires adding significant complexity to your app, terminating the app may be a simpler solution. Also, if your app consumes a large amount of memory and cannot easily release any of it, the system might need to kill your app quickly anyway to make room for other apps" – Kaan Dedeoglu Apr 29 '12 at 21:49
2

Choose the 'application does not run in background' option in your project's plist. If the option isn't there, press the '+' on the side to add the property.

enter image description here

This will ensure that the app starts afresh every time it's opened.

Liam George Betsworth
  • 18,373
  • 5
  • 39
  • 42
  • Thanks, I've already found it as the guy before you gave me the hint to check the plist file :) – oybcs Apr 29 '12 at 16:46