iphone中按Home键退出程序:
1、按Home键的触发事件:
在对应的AppDelegate的方法
- (void)applicationWillResignActive:(UIApplication *)application
我一直错误以为是:
- (void)applicationWillTerminate:(UIApplication *)application
2、退出程序:
[application terminateWithSuccess];
或[[UIApplication sharedApplication] terminateWithSuccess];
或exit(0);