【发布时间】:2014-07-02 13:27:41
【问题描述】:
我正在开发一个应用程序,用于在蜂窝数据关闭或 WiFi 未连接时获取当前位置。
我使用了以下代码,但我得到的只有纬度和经度,没有带地址的位置。
所以我需要指导来实施它。
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
NSLog(@"didUpdateToLocation: %@", newLocation);
CLLocation *currentLocation1 = newLocation;
if (currentLocation1 != nil)
{
strLet=[NSString stringWithFormat:@"%f",currentLocation1.coordinate.latitude];
strLong=[NSString stringWithFormat:@"%f",currentLocation1.coordinate.longitude];
NSLog(@"%f",currentLocation1.coordinate.longitude);
NSLog(@"%f",currentLocation1.coordinate.latitude);
}
}
谢谢。
【问题讨论】:
-
“完美位置”是什么意思?
-
查看有问题的变化
-
您要的是纬度、经度(请参阅您的问题的标题),现在您声称您得到了纬度/经度,但还想要一个地址?
-
您从该位置获取地址的代码在哪里?
标签: ios iphone location cllocation