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

查看:34
本文介绍了退出 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天全站免登陆