正确的方式退出iPhone应用程序? [英] Proper way to exit iPhone application?

查看:133
本文介绍了正确的方式退出iPhone应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个iPhone应用程序,并且由于某些用户操作,我需要强制退出。

I am programming an iPhone app, and I need to force it to exit due to certain user actions. After cleaning up memory the app allocated, what's the appropriate method to call to terminate the application?

推荐答案

您尝试过 exit(0)

或者, [[NSThread mainThread] exit] ,虽然我没有试过,似乎更适合的解决方案。

Alternatively, [[NSThread mainThread] exit], although I have not tried that it seems like the more appropriate solution.

这篇关于正确的方式退出iPhone应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆