如何从我的代码访问iPhone的设置? [英] How do I access the iPhone's settings from my code?

查看:87
本文介绍了如何从我的代码访问iPhone的设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要做的就是能够判断我的应用程序的用户是否正在使用24小时制。我意识到我无法设置这些设置,我只想阅读它们。
如果您不知道我在说什么,我希望能够读取用户在iPhone的内置设置应用中设置的值。以灰色齿轮作为图标的那个。

All I want to do is be able to tell whether or not a user of my app is using the 24-hour clock or not. I realize that I can't set these settings, I just want to read them. If you don't know what I'm talking about, I want to be able to read the values a user has set in the built-in "Settings" app of the iPhone. The one with the gray gears as the icon.

我尝试使用谷歌搜索可能提供答案的各种搜索,但这不起作用。我试着浏览一下Apple为xcode程序员提供的文档,但这也没有改变。

I tried googling a variety of searches that might provide an answer, but that didn't work. I tried looking through the documentation that Apple provides for xcode programmers, but that didn't turn anything up, either.

推荐答案

如果您想要此信息以显示时间,您无需查询设置应用。 NSDateFormatter 将根据用户的设置自动格式化时间。

If you want this information in order to display a time, you don't need to query the Settings app. NSDateFormatter will format the time according to the user's settings automatically.

这篇关于如何从我的代码访问iPhone的设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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