iPhone 设置捆绑包

发布于 2024-08-11 16:54:17 字数 226 浏览 3 评论 0原文

我想允许用户使用 iPhone 的设置应用程序输入有效日期。

我尝试过许多 PreferenceSpecifiers 数据节点类型,包括日期。

我有两个问题:

  1. 当我指定日期作为类型时,设置应用程序中的应用程序崩溃。我们将不胜感激工作示例。

  2. 由于这种方法对我来说还不起作用,我是否能够以编程方式验证用户输入的日期?

I want to allow the user to enter a valid date using the iPhone’s settings application.

I have experimented with many of the PreferenceSpecifiers data node types including date.

I have two issues:

  1. When I specify date as the type, my app within the settings app crashes. Working examples would be greatly appreciated.

  2. Since this approach hasn’t worked for me yet, will I programmatically be able to validate the date that the user enters?

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

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

发布评论

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

评论(2

蘸点软妹酱 2024-08-18 16:54:17

第 2 点的答案是否定的。您唯一可以验证输入的数据的时间是您的应用程序下次启动时。您的应用程序的代码都不是通过“设置”应用程序运行的。

您可以考虑将此设置引入您的应用程序中。

The answer to number 2 is no. The only time you can validate the data entered is the next time your app is launched. None of your app's code is run via the Settings app.

You might consider pulling this setting into your app.

蓝海 2024-08-18 16:54:17

您是否已阅读本指南并且

您将无法验证用户通过“设置”应用程序设置的任何内容。另外,我在任何地方都没有将日期视为有效的设置类型,因此我什至认为这不可能通过“设置”应用程序实现。

我只需在应用程序中创建一个设置视图。这样您就可以根据需要控制自定义逻辑。

Have you read this guide and this section of the App guide? They describe in detail how the settings like this work.

You won't be able to validate anything a user sets through the Settings application. Also, I don't see Date as a valid setting type anywhere, so I don't even think this is possible through the Settings application.

I would simply create a settings view within the application. That way you can control your custom logic as you see fit.

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