获取与iphone设置应用程序中类似的时区列表 [英] Get the similar timezone list as in iphone Settings app

查看:108
本文介绍了获取与iphone设置应用程序中类似的时区列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用

NSArray *timezoneNames = [NSTimeZone knownTimeZoneNames] ;

但生成的时区列表并未涵盖所有主要城市名称。像印度一样,它只显示加尔各答市。虽然我期望也显示新德里(首都)的时区。

but the generated list of timezones does not cover all the major city names. Like for India it shows only Kolkata city. While I expected to display the timezone for New Delhi (capital) also.

所以我想生成与iOS在其设置 - >常规 - >中生成的相同的时区列表日期时间 - >时区因为它显示了世界上几乎所有主要城市。我们可以获取此列表吗?或者我们是否需要为此创建我们自己的数据库(例如 .plist )?

So I want to generate the same timezones list as iOS generates in its Settings->General->Date Time-> Timezone because it shows almost all the major cities of the world. Can we fetch this list? Or do we need to create our own database(say .plist) for this?

推荐答案

Settings.app使用plist文件显示时区列表。文件名为: all_cities_adj.plist
要访问此文件,您需要深入到SDK本身。
我已经在下面提到了你可以找到它的遍历路径。

Settings.app uses a plist file to display the timezone list. The name of file is: "all_cities_adj.plist". To get to this file you need to traverse deep down into the SDK itself. I have mentioned the traverse path below where you can find it.

1.转到你拥有Xcode的文件夹。
2.右键单击它,然后单击显示包内容
3.然后目录 - > 开发人员 - > 平台 - > iPhoneSimulator.platform - > 开发人员 - > SDK - > iPhoneSimulator6.1.sdk - > 系统 - > 图书馆 - > PrivateFrameworks - > AppSupport.framework
4.在此文件夹中,您可以找到plist文件。

1.Go to the folder where you have your Xcode. 2.Right-Click on it and then click Show Package Contents. 3.Then Contents --> Developer --> Platforms --> iPhoneSimulator.platform --> Developer --> SDKs --> iPhoneSimulator6.1.sdk --> System --> Library --> PrivateFrameworks --> AppSupport.framework 4.In this folder you can find the plist file.

请告诉我是否有帮助......

Please let me know if it helped...

这篇关于获取与iphone设置应用程序中类似的时区列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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