'[아이폰] CLLocationDegrees < - > NSString'에 해당되는 글 1건

  1. 2012.05.25 [아이폰] CLLocationDegrees < - > NSString
개발도구/아이폰2012.05.25 19:01
  

위치 값 - CLLocationDegrees 스트링 형식의 디비에 넣거나 web전송을 위해 형변환은 필수이다

CLLocationDegrees - > NSString

NSNumber *firstNumber = [NSNumber numberWithInt:123456789];
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
[formatter setNumberStyle:NSNumberFormatterDecimalStyle];
NSString *convertNumber = [formatter stringForObjectValue:firstNumber];
NSLog(@"value : %@", convertNumber);
또는
1. NSLog(@"Value: %f", currentLocation.coordinate.latitude); //Tried with all NSLog specifiers.
2. NSNumber *tmp = [[NSNumber alloc] initWithDouble:currentLocation.coordinate.latitude];
3. NSString *tmp = [[NSString alloc] initWithFormat:@"%@", currentLocation.coordinate.latitude];
NSString - > CLLocationDegrees

CLLocationDegrees lat = [ufeedJobLatitude doubleValue];

CLLocationDegrees lon = [ufeedJobLongitude doubleValue];

Posted by 예배하는 프로그래머