我的经度为 -122.406417 并且 self.actualLongitude 是双重成员。
NSLog(@"original lon: %f", [self.tempLocation coordinate].longitude);
NSLog(@"original lat: %f", [self.tempLocation coordinate].latitude);
NSLog(@"original alt: %f", [self.tempLocation altitude]);
self.actualLongitude = [self.tempLocation coordinate].longitude;
self.actualLatitude = [self.tempLocation coordinate].latitude;
self.actualLongitude = [self.tempLocation altitude];
NSLog(@"new lon: %f", self.actualLongitude);
NSLog(@"new lat: %f", self.actualLatitude);
NSLog(@"new alt: %f", self.actualAltitude);
那么为什么 self.actualLongitude 是 0.000000 呢?
2013-02-06 14:19:59.386 GeoCatching[4733:c07] 原始经度:-122.406417
2013-02-06 14:19:59.386 GeoCatching[4733:c07] 原始纬度:37.785834
2013-02-06 14:19:59.387 GeoCatching[4733:c07] 原始 alt: 0.000000
2013-02-06 14:19:59.387 GeoCatching[4733:c07] 新经度:0.000000
2013-02-06 14:19:59.387 GeoCatching[4733:c07] 新纬度:37.785834
2013-02-06 14:19:59.388 GeoCatching[4733:c07] 新 alt: 0.000000
注意:正值是正确的。我正在使用模拟器。
最佳答案
在你的 3 个作业的最后一行:
self.actualLongitude = [self.tempLocation altitude];
你用 altitude 覆盖了 self.actualLongitude
的值(这发生了
为零)。
你可能是说
self.actualAltitude = [self.tempLocation altitude];
关于iphone - CLLocation 和 double 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14729712/