I have a longitude with -122.406417 and self.actualLongitude is a double member.
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);
So why is self.actualLongitude 0.000000 ?
2013-02-06 14:19:59.386 GeoCatching[4733:c07] original lon: -122.406417
2013-02-06 14:19:59.386 GeoCatching[4733:c07] original lat: 37.785834
2013-02-06 14:19:59.387 GeoCatching[4733:c07] original alt: 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] new lat: 37.785834
2013-02-06 14:19:59.388 GeoCatching[4733:c07] new alt: 0.000000
Note: Positive values are correct. I am using the simulator.
In the last line of your 3 assignments:
self.actualLongitude = [self.tempLocation altitude];
you overwrite the value of self.actualLongitude
with the altitude (which happens
to be zero).
You probably mean
self.actualAltitude = [self.tempLocation altitude];