tags:

views:

59

answers:

2

I need to exit my app while my app enter into background

A: 

I guess you want to close your iPhone/iPad app when the application is entering into the background :

In applicationWillEnterBackground of your app delegate you can do [[NSThread mainThread] exit] or exit(0)

William Remacle
Apple specifically recommends against this, because it acts like a crash. Jason's suggestion of using the UIApplicationExitsOnSuspend property list key is a much better way of handling this. In any case, exiting on going to the background is recommended against in all but a few cases.
Brad Larson
Ow thank you, good to know :-)
William Remacle
+1  A: 

If you never want your app to enter the background set the UIApplicationExitsOnSuspend key in your application’s Info.plist file to YES

Opting Out of Background Execution

Jason Harwig