- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation {
if (startingPoint == nil)
self.startingPoint = newLocation
CLLocationDistance distance = [newLocation
getDistanceFrom:startingPoint];
NSString *distanceString = [[NSString alloc]
initWithFormat:@"%.2f Miles", totalDistance *0.000621371];
DistanceTotal.text = distanceString;
}
@end
我正在为我的应用程序制作一个距离计算器。当我运行应用程序时,文本字段为空白,没有距离信息。你能帮我找到问题吗。(文本字段称为 DistanceTotal)谢谢 :)