Generating a String from CLLocationDegrees, e.g. in NSLog or StringWithFormat

These are correct:

NSLog(@"Value: %f", currentLocation.coordinate.latitude); //Tried with all NSLog specifiers.
NSNumber *tmp = [[NSNumber alloc] initWithDouble:currentLocation.coordinate.latitude];

This is wrong, because coordinate.latitude isn't an object as nsstring might expect.

NSString *tmp = [[NSString alloc] initWithFormat:@"%@", currentLocation.coordinate.latitude];

If you want an NSString:

myString = [[NSNumber numberWithDouble:currentLocation.coordinate.latitude] stringValue];

or

NSString *tmp = [[NSString alloc] initWithFormat:@"%f", currentLocation.coordinate.latitude];

Marco


Swift version:

Latitude to String:

var latitudeText = "\(currentLocation.coordinate.latitude)"

or

let latitudeText = String(format: "%f", currentLocation.coordinate.latitude)