我不明白文档中的这个例子:该timeIntervalSinceNow
方法应该显示一个正值,但是我们怎样才能达到代码中提到的“5”?(我认为它或多或少是 0,或 -10、-20、-30 等......但我们怎样才能得到一个正值,比如 5?):
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
// test the age of the location measurement to determine if the measurement is cached
// in most cases you will not want to rely on cached measurements
NSTimeInterval locationAge = -[newLocation.timestamp timeIntervalSinceNow];
if (locationAge > 5.0) return;
谢谢你的帮助