IOS位置更新与NSTimer

我想每秒钟获得一次位置更新。 这个时间间隔对于我想创build的animation非常重要,以保持真实的速度。 我明白,[myLocationManager startUpdatingLocation]将自动轮询“didUpdateToLocations”,但它不是完全每秒一次。

有什么方法可以使用NSTimer每秒钟准确地获得我的位置?

谢谢你,jj

- (void)startUpdatingLocation self.locationManager = [CLLocationManager new]; self.locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation; self.locationManager.delegate = self; [self.locationManager startUpdatingLocation]; NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(updateLocation) userInfo:nil repeats:YES]; } - (void)updateLocation { CLLocation location = self.locationManager.location; // do all the work here } #pragma mark - CLLocationManagerDelegate - (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations { // do nothing here }