iOS 5+에서는 CLGeocoder
및 그 reverseGeocodeLocation:completionHandler:
방법을 사용합니다.
귀하의 경우 아마도 areasOfInterest
속성에 가장 관심이있을 것입니다.
예 :
CLGeocoder* gc = [[CLGeocoder alloc] init];
double lat, lon; // get these where you will
[gc reverseGeocodeLocation:[[CLLocation alloc] initWithLatitude:lat longitude:lon] completionHandler:^(NSArray *placemarks, NSError *error) {
for (CLPlacemark* place in placemarks) {
if (place.region)
NSLog(@"%@", place.region);
// throroughfare is street name, subThoroughfare is street number
if (place.thoroughfare)
NSLog(@"%@ %@", place.subThoroughfare, place.thoroughfare);
for (NSString* aoi in place.areasOfInterest)
NSLog(@"%@", aoi);
}
}];
어떻게 이름을 정의하는? 주소? 상인? –
학교에 가볍게 두드리는 것처럼 현재 위치 이름이 필요합니다. 응답으로 나는 그 특정 학교 이름을 얻습니다. 가능합니까? 어떻게 할 수 있니? – Aleem