我得到了经度和纬度值,并将其保存在标签中,它很容易显示在我的应用程序中,但我想要当前位置的详细信息,主要是地点的名称。
我使用了 MKReverseGeocoder。我做了这个代码
- (void)locationUpdate:(CLLocation *)location
{
CLLocationCoordinate2D coord;
coord.longitude=[NSString stringWithFormat:@"LATITUDE: %f", location.coordinate.latitude];
MKReverseGeocoder *geocoder=[[MKReverseGeocoder alloc]initWithCoordinate:coord];
[geocoder setDelegate:self];
[geocoder start];
latlbl.text = [NSString stringWithFormat:@"LATITUDE: %f", location.coordinate.latitude];
lonlbl.text = [NSString stringWithFormat:@"LONGITUDE: %f", location.coordinate.longitude];
//txtlocate.text = [location description];
}
![-(void)reverseGeocoder:(MKReverseGeocoder)geocoder didFindPlacemark:(MKPlacemark *)placemark
{
NSLog(@"%@",\[placemark addressDictionary\]
}
这是我得到的错误...
在此先感谢