2013-01-19 27 views
0

我正在开发基于地理编码的应用程序。我在地理编码器委托方法内使用地标地址字典方法。除了印度的邮政编码外,我可以获得所有的细节(街道,城市,州,县,国家代码和所有)。为什么邮政编码缺失?任何建议都赞赏使用MKReverseGeocoder获取印度位置的邮政编码

我的代码:

-(void)locationUpdate:(CLLocation *)location 

{ 

currentLocation= [location coordinate]; 

if (currentLocation.latitude!=checking.latitude) 
{ 
    NSDate *currentTime =[NSDate date]; 

    fireTime = currentTime; 

    checking.latitude=currentLocation.latitude; 
    checking.longitude=currentLocation.longitude; 

} 
MKReverseGeocoder *geocoder = [[MKReverseGeocoder alloc] initWithCoordinate:[location coordinate]]; 
[geocoder setDelegate:self]; 
[geocoder start]; 
} 


-(void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark 

{ 
    NSLog(@"placemark.postalCode ***********%@",placemark.postalCode); 
} 

我得到这个输出作为地理编码器返回:

{ 

City = Vishakhapatnam; 
Country = India; 
CountryCode = IN; 
FormattedAddressLines =  (
    NH5, 
    Vishakhapatnam, 
    "Andhra Pradesh", 
    India 
); 
State = "Andhra Pradesh"; 
Street = NH5; 
Thoroughfare = NH5; 

} 



placemark.postalCode *********** (null) 

其工作正常,其他国家,但我没有得到邮编为印度地点。我怎样才能得到印度地区的邮政编码?

+0

兄弟,如果您仍在使用iOS Maps API,则需要弄清楚。 – MCKapur

回答

相关问题