它看起來像你可以標做的最好的是
[locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
這篇帖子可能是一些使用iOS: get Accurate Reverse Geocoding using CLLocationManager?
另外值得一提的是,在地方布萊頓的運用波士頓仍然是一個有效的地址對於相同的位置。
http://support.apple.com/kb/HT1975
這爲我工作:
- (void) resetLocationData{
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
[locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
[locationManager startUpdatingLocation];
NSLog(@"LAT: %f", [locationManager location].coordinate.latitude);
NSString *latitude = [NSString stringWithFormat:@"%f", [locationManager location].coordinate.latitude];
NSString *longitude = [NSString stringWithFormat:@"%f", [locationManager location].coordinate.longitude];
NSString *latlong = [NSString stringWithFormat:@"%@,%@", latitude, longitude];
NSLog(@"LONG: %f", [locationManager location].coordinate.longitude);
NSLog(@"Combined Location: %@", latlong);
[[locationManager location]timestamp];
}
#pragma mark - CLLOCATION STUFF
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
self.currentLocation = newLocation;
CLGeocoder *geocoder = [[CLGeocoder alloc] init];
[geocoder reverseGeocodeLocation:self.currentLocation completionHandler:^(NSArray *placemarks, NSError *error)
{
NSLog(@"Placemark is %@", placemarks);
CLPlacemark *place = [placemarks objectAtIndex:0];
NSLog(@"placemark 0: %@", place);
// locationLabel.text = placemarks;
}];
if(newLocation.horizontalAccuracy <= 100.0f) {
[locationManager stopUpdatingLocation];
}
}
日誌輸出:
2013年1月13日23:23:05.508 CLLocationTest [47617:907]標爲( 「XX XXXXXX Rd,XX XXXXXX Rd,Brighton,MA 02135,United States @ < + 42.XXXXXX,-71.XXXXXXX> +/- 100.00m」
offhand,它看起來像locationManager可能使用更接近CLLocationAccuracy值。 – propstm
地標也有['subLocality'](http://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLPlacemark_class/Reference/Reference.html#//apple_ref/occ/instp/CLPlacemark/subLocality )屬性,在可能的情況下,它包含更具體的信息,例如城市內的鄰居/行政區/地區的名稱 - 這可能是登錄到控制檯的「說明」所用的內容,這可以解釋爲什麼您在布萊頓看到這個城市是波士頓。 – rickster
所以我認爲會是這樣,但subLocality給了另一個更具體的位置,而不是布賴頓或波士頓。我仍然沒有找到'描述'從 – Jonathan