0
基本上,我的应用程序中的位置控制器正常工作。但是,如果它运行了很长时间,它就会在不承认它的情况下出错。我认为gps缓冲区溢出或那种。GPS获取错误位置
这里是我的didUpdate-事件
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
//nonvalid
if (signbit(newLocation.horizontalAccuracy))
return;
//0.0 is no valid location here
if ((abs(newLocation.coordinate.latitude) < 1.0e-05) || (abs(newLocation.coordinate.longitude) < 1.0e-05))
return;
if (newLocation.horizontalAccuracy > DBL_MAX)
return;
@synchronized(self)
{
currentCoordinate.latitude = newLocation.coordinate.latitude;
currentCoordinate.longitude = newLocation.coordinate.longitude;
}
}
代码有可能刷新位置缓存? 或用三角测量值来控制位置?
只要添加标签“iphone”,就不必在标题中包含“iPhone”。 :) – Emil 2010-06-25 12:43:24
你在说多久?这似乎不太可能,这不会完全由苹果测试;) – deanWombourne 2010-06-25 13:33:04