Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我只是使用时区,我似乎无法找到是否需要位置服务提示?我在测试时关闭了手机上的定位服务,但它仍然可以找到我的时区。我只是不想被苹果拒绝。
我正在使用这个: var timeZone = NSTimeZone.localTimeZone().name
谢谢你的帮助。
基思
不会。在创建 NSDate 对象时,您将永远不会收到默认使用的 localtimezone 提示。顺便说一句,您没有像这样定义任何时区,您只是将本地时区的名称分配给 var。
如果您需要有关时区的更多信息,您应该查看此链接:
使用 NSTimeZone 框架