Atm*_*tma 1 cocoa cocoa-touch latitude-longitude nsstring cllocation
我正在尝试将CLLocation纬度/经度转换为字符串.我可以使用以下代码成功完成此操作:
// extract latitude from CLLocation object and cast to string
NSString *latitude = [[NSString alloc] initWithFormat:@"%g°", location.coordinate.latitude];
Run Code Online (Sandbox Code Playgroud)
这给了我一个像34.10111º的值.我希望这个数字是一个没有º度符号的纯字符串.
我应该用不同的格式初始化字符串吗?
我尝试使用格式@"%d"启动,字符串完全出现在另一个数字上.
| 归档时间: |
|
| 查看次数: |
11239 次 |
| 最近记录: |