位置服务不提供iOS SDK中的所有数据

时间:2014-06-14 06:12:02

标签: ios core-location cllocationmanager reverse-geocoding

在执行代码时显示(null) (null),Ahmedabad Gujarat (null) (null)

- (void)locationManager:(CLLocationManager *)manager
    didUpdateToLocation:(CLLocation *)newLocation
           fromLocation:(CLLocation *)oldLocation
{
    _CurrentLocation = newLocation.coordinate;

    CLGeocoder * geoCoder = [[CLGeocoder alloc] init];
    [geoCoder reverseGeocodeLocation:newLocation completionHandler:^(NSArray *placemarks, NSError *error)
    {
        for (CLPlacemark * placemark in placemarks)
        {
            NSString *addressTxt = [NSString stringWithFormat:@"%@ %@,%@ %@ %@ %@",
                                    [placemark subThoroughfare],[placemark thoroughfare],
                                    [placemark locality], [placemark administrativeArea], [placemark subLocality],[placemark subAdministrativeArea]];
            NSLog(@" >> %@",addressTxt);
            self.strLocation = [placemark locality];
        }
    }];
}

如何获得其他价值?位置服务是否不会在我的区域提供这些数据? 如果没有那么任何替代方法来获取这些数据?

0 个答案:

没有答案