xstrich没有出现在工作区中。你能建议我怎么解决它?
func locationManager(manager: CLLocationManager, didUpdateToLocation newLocation: CLLocation, fromLocation oldLocation: CLLocation) {
if !self.locations.isEmpty {
distance += newLocation.distanceFromLocation(self.locations.last!)
print("distance \(distance)")
}
self.locations.append(newLocation)
if UIApplication.sharedApplication().applicationState == .Active {
if let currentDest = navigationCoordinator.coordinates.first as CLLocationCoordinate2D? {
mapView.clear()
updateViewMapWith(newLocation.coordinate, destLocation: currentDest)
}
}
}
答案 0 :(得分:5)
显然! 在具有递减顺序的循环时,永远不会达到内部操作:
path
更改订单或使用for k = 3527:3071
% never reaches here
end
。
-1
<强>更新强>
更新问题后,现在应检查是否符合for k = 3527:-1:3071
% reaches here
end
的条件。这意味着,