如何在用户点击按钮时以编程方式关闭应用程序 [英] How to close an application programmatically when the user taps on a button

查看:96
本文介绍了如何在用户点击按钮时以编程方式关闭应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当用户点击按钮时我都需要关闭应用程序(我需要保留IBAction以关闭应用程序)。就像在游戏菜单中我们点击它时我们有退出按钮我们从游戏中出来。我喜欢的事情我需要。我怎么能这样做。谢谢提前

I need to close the application whenever user taps on the button(i need to keep IBAction for closing the app).Like in games menu we have exit button when we tap on it we come out from the game.Same thing i need.How can i do this .Thanks in advance

推荐答案

请参阅:
如何以编程方式退出我的iPhone应用程序?

警告:可以通过调用exit退出
应用程序。
应用程序调用exit将显示
给用户崩溃,而不是
,而不是执行正常终止
并动画回到主屏幕。
此类用法提供负
体验,并且强烈建议不要支付b $ b。

WARNING: It is possible to quit the application by calling exit. Applications calling exit will appear to the user to have crashed, rather than performing a graceful termination and animating back to the Home screen. Such usage provides a negative experience and is strongly discouraged.

这篇关于如何在用户点击按钮时以编程方式关闭应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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