iOS - 如何以编程方式设置日期和时间 [英] iOS - How to set the date and time programatically
问题描述
我有一个要求,我们需要从服务器编程设置日期和时间(或同步时间)。
I have a requirement in which we need to programatically set the date and time (or sync the time) from a server.
我做了一些研究,但是没有得到具体的答案。
I did some research on this but did not get a concrete answer. Was just wondering if anyone has done this in iOS?
有没有苹果文档说我们不能这样做?
Is there any Apple documentation which says we cannot do this?
推荐答案
您不能以编程方式在iPhone / iPad上设置日期和/或时间。这些API被认为受苹果保护。
You can't set the date and/or time on iPhone/iPad programmatically. Those APIs are considered protected by Apple. In other words if you were to use those APIs and submit an app using them it would be rejected.
编辑:
要获取此文档,您可以使用您的开发人员程序中包含的一个免费技术支持事件联系Apple开发人员技术支持。 LINK
To get documentation on this you can contact Apple Developer Technical Support using one of your free tech support incidents included with your developer program. LINK
这篇关于iOS - 如何以编程方式设置日期和时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!