1

I've noticed that pressing the iphone button using SDK 4 sends the application in background. Since I'm dealing with login and other problems I find better closing the app instead of sending it in background status. So I would put an exit(0); statement inside (void)applicationDidEnterBackground:(UIApplication *)application.

Is it a correct approach or is against Apple guidelines?

Noya
  • 3,879
  • 3
  • 26
  • 32
  • 1
    Don't do that. Just don't. What problems do you have with the background mode? Can you be a little more specific? – Costique Jul 20 '10 at 09:18
  • the main concern was that my app is enabled to open pdf file from Mail or Safari. But if I start my app then send it in background, if i open the app via Safari or Mail it just don't open the file because it doesn't call (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions method again – Noya Jul 20 '10 at 09:21

1 Answers1

3

actually i found the answer by myself: I can set in the info.plst the option "Application does not run in background" to control this behavior instead of using exit(0) command

Noya
  • 3,879
  • 3
  • 26
  • 32
  • 1
    There you go. Also, I don't know if it's a concern for you or not, but an app that calls `exit(0)` violates the Human Interface Guidelines rather seriously and runs a substantial risk of not being allowed into the app store. – Dan Ray Jul 20 '10 at 12:12