1

我的经度为 -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] 原始 lon:-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] 新 lon: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

注意:正值是正确的。我正在使用模拟器。

4

1 回答 1

2

在你的 3 个作业的最后一行:

self.actualLongitude = [self.tempLocation altitude];

self.actualLongitude你用高度覆盖的值(恰好为零)。

你大概是说

self.actualAltitude = [self.tempLocation altitude];
于 2013-02-06T13:29:19.230 回答