iOS: CLLocationManager altitude returns only Integers

113 views Asked by At

Im trying to get the altitude of the CLLocationManager in iOS 9.3.2.

self.locationManager = [[CLLocationManager alloc] init];

self.locationManager.distanceFilter = kCLDistanceFilterNone;
self.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
[self.locationManager requestWhenInUseAuthorization];
[self.locationManager startUpdatingLocation];

A simple

NSLog(@"location Manager altitude: %.6f", self.locationManager.location.altitude);

returns exact values when running it on an iPhone 5S 340.234567, but on an iPhone 4S, I get only Integer Values: 340.000000.

I implemented the delegates didUpdateLocations and didFailWithError

I tried it with Wi-fi or mobile Data enabled, no difference. Any Ideas?

0

There are 0 answers