我有一個經度-122.406417和self.actualLongitude是雙成員。問題與CLLocation和雙重
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年2月6日14:19:59.386 GeoCatching [4733:C07]原始經度:-122.406417
2013年2月6日14:19:59.386 GeoCatching [4733:C07]原始緯度:37.785834
2013-02-06 14:19:59.387 GeoCatching [4733:c07]原始替換:0.000000
2013-02-06 14:19:59.387 GeoCatching [4733:c07] new lon:0.000000
2013-02-06 14 :19:59.387 GeoCatching [4733:C07]新緯度:37.785834
2013年2月6日14:19:59.388 GeoCatching [4733:C07]新ALT:0.000000
注意:正值是正確的。我正在使用模擬器。
你肯定self.tempLocation被兩次返回同樣的事情?你是否已經實現了自己的setter或getter for self.actualLongitude? –
什麼是self.actualLongitude的類型? – occulus
是的,getter和setter是爲self.actualLongitude實現的。 Self.actualLongitude是雙倍的。我在緯度和高度上也是這樣。就像我說的,只有負面的不正確在我的成員。 – Retterdesdialogs