How do I access the iPhone's settings from my

2020-03-03 06:21发布

问题:

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.

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.

回答1:

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.