我正在使用 CoreLocation 框架,我很好奇它多久更新一次,它真的不准确,我正在争论从 NSTimer 调用该方法以增加其使用频率。我的代码在下面
在 ViewDidLoad
//location update
CLController = [[CoreLocationController alloc] init];
CLController.delegate = self;
[CLController.locMgr startUpdatingLocation];
我的无效方法
- (void)locationUpdate:(CLLocation *)location {
int speedInt = [location speed]*2.23693629;
if(speedInt < 0){
speedInt = 0;
}
speedLabel.text = [NSString stringWithFormat:@"%d", speedInt];
}
- (void)locationError:(NSError *)error {
speedLabel.text = [error description];
}