如何在Objective-C中关闭iPad应用程序? [英] How can I close an iPad app in Objective-C?
问题描述
我想通过点击UIButton来关闭iPad应用程序。但是,我还没有看到如何在Apple文档中执行此操作。
I would like to close an iPad application as a result of clicking on a UIButton. However, I have not seen how to do this in the Apple documentation.
关闭应用程序需要进行哪些调用?
What call needs to be made to close an app?
谢谢。
推荐答案
您可以调用exit(0)来终止该应用。但Apple并不喜欢这样,因为这会给用户带来突然崩溃的感觉。如果您仍希望拥有退出功能(可能存在拒绝风险),那么您还应该在执行退出之前向app app委托发送applicationWillTerminate消息(如果您有任何重要信息)。
You can call exit(0) to terminate the app. But Apple don't like this as this gives the user a feeling of sudden crash. If you still want to have an exit function (with a potential risk of rejection) then you should also send your app delegate the applicationWillTerminate message (if you have anything important there) before performing the exit.
这篇关于如何在Objective-C中关闭iPad应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!