【发布时间】:2013-07-10 11:52:06
【问题描述】:
我正在使用GPS (没有互联网)找到当前的latitude 和longitude。
现在我想在没有互联网的情况下通过 GPS 使用该纬度和经度来实现 reverse geocoding。
我已经成功实现了互联网连接的反向地理编码。
这是我实现的代码:-
CLGeocoder * geoCoder = [[CLGeocoder alloc] init];
[geoCoder reverseGeocodeLocation:newLocation completionHandler:^(NSArray *placemarks, NSError *error) {
NSString * location = ([placemarks count] > 0) ? [[placemarks objectAtIndex:0] locality] : @"Not Found";
CLPlacemark *placemark = [placemarks objectAtIndex:0];
NSString *MyAddress = @"";
MyAddress = [[placemark.addressDictionary objectForKey:@"FormattedAddressLines"] componentsJoinedByString:@", "];
NSLog(@"address is %@", MyAddress);
}];
我已经搜索过这个,但找不到任何解决方案。
我该怎么做?
谢谢。
【问题讨论】:
-
这个问题的答案不是很好,仅供参考。
标签: iphone ios objective-c gps