I have found many apps where you can press a button or something similar and the application will terminate and bring you back to the home screen. How would I do this?
Asked
Active
Viewed 236 times
-3
-
I downvoted this question because the subject is totally not to the point. – Stefan Arentz Jan 29 '10 at 03:38
-
This is a duplicate of http://stackoverflow.com/questions/355168/proper-way-to-exit-iphone-application – Brad Larson Jan 29 '10 at 18:49
2 Answers
1
exit(0);
this can exit the app .
again, the best way I think will be like as follows:
//@step invoke the normal routine applicationWillTerminate
if ([[UIApplication sharedApplication].delegate respondsToSelector:@selector(applicationWillTerminate:)])
{
[[UIApplication sharedApplication].delegate performSelector:@selector(applicationWillTerminate:) withObject:[UIApplication sharedApplication]];
}
//@step force quite app
kill(getpid(), SIGINT);
I got it from other post on the overflow :D

iXcoder
- 1,564
- 4
- 20
- 41
0
from http://www.iphonedevsdk.com/forum/iphone-sdk-development/6928-exit-application.html
[[UIApplication sharedApplication] terminateWithSuccess];

John Boker
- 82,559
- 17
- 97
- 130
-
1
-
-
Did so ask for public - what is iPhone sdk 3.0? if not public. – Aran Mulholland Feb 01 '10 at 02:51