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
2010-10-06 09:30:15
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
2010-10-06 16:36:48
Ow thank you, good to know :-)
William Remacle
2010-10-06 20:27:01
+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
Jason Harwig
2010-10-06 14:39:25