views:

176

answers:

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?

+3  A: 

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
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
thanks Dan, i supposed it wasn't a good idea :)
Noya