以编程方式暂停/关闭应用程序

发布于 2024-12-23 00:55:40 字数 144 浏览 2 评论 0原文

如何以编程方式暂停/关闭我的 iPad 应用程序?我想在应用程序启动时显示使用条款。如果用户按下接受按钮,应用程序应该继续。如果用户按下“拒绝”按钮,则应用程序应暂停/关闭。

PS:该应用程序是使用 Titanium Appcelerator 框架构建的。

How can I suspend/close my iPad app programmatically? I wanted to show the terms of use on app start up. If user presses the Accept button the app should continue. If user presses the Decline button the app should be suspended/closed.

PS : The app is built using Titanium Appcelerator framework.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

假装不在乎 2024-12-30 00:55:41

你可以尝试调用 exit() 但是,说实话,我怀疑你想要的行为是可取的。我还没有看到任何其他应用程序这样做 - 我不确定苹果是否会接受它。

you could try calling exit() but, to be honest, i doubt that the behaviour you want is desirable. i haven't seen any other apps do it - i'm not sure it'd be considered acceptable by Apple.

离不开的别离 2024-12-30 00:55:41

您永远不会退出 iPhone 或 iPad 应用程序。
如果确实如此,苹果会将其视为崩溃并肯定会拒绝您的应用程序。

对于您的情况,最好的解决方案是显示另一个屏幕,其中显示一条消息,例如:“在接受条款之前,您无法访问该应用程序”或类似的内容。

You never exit from an iPhone or iPad application.
If it does apple takes it as a crash and surely reject your application.

In your case, the best solution will be displaying another screen which display a message like: "You cannot access the application until you accept the terms" or something like that.

孤独岁月 2024-12-30 00:55:41

您可以使用exit(0);每当您想退出应用程序时。我已经在我的项目中实现了这段代码,它对我来说工作得很好。

You can use exit(0); whenever you want to exit the app. I have implemented this code in my project and it works perfectly fine for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文