目印でできる最善のことは
[locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
この投稿はiOSで役立つ可能性があります: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-01-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」