如果用户设置 "Set Automatically" 关闭,如何检查正确的当前时间

How to check the correct current time if user sets "Set Automatically" off

如果用户将 "Set Automatically" 设置为关闭,我必须检查正确的当前时间。

有什么方法可以访问 "Set Automatically" 设置状态的状态,以便我可以提示用户将其打开。 要么 我可以遵循的另一种方法我可以从 GPS(位置)获取时间,但是下面的代码总是在用户选择的情况下给出当地时间 "Set Automatically"关闭。

CLLocation* location = [[CLLocation alloc] initWithLatitude:(CLLocationDegrees) 0.0 longitude:(CLLocationDegrees) 0.0];
NSDate* now = location.timestamp;

有什么方法可以在 ios 中存档此行为。

如果不能依赖本地时钟,则需要使用外部时钟源。为此(可能)有几个基于 NTP 的库。例如:ios-ntp,目前可以找到here.