如何在iOS中以编程方式设置日期和时间 [英] How to set the date and time programmatically in iOS
问题描述
我有一个要求,我们需要以编程方式从服务器设置日期和时间(或同步时间).
I have a requirement in which we need to programmatically set the date and time (or sync the time) from a server.
如何在iOS中完成
是否有任何Apple文档说我们无法做到这一点?
Is there any Apple documentation which says we cannot do this?
推荐答案
您无法通过编程方式在iPhone/iPad上设置日期和/或时间.这些API被认为受Apple保护.换句话说,如果您要使用这些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屋!