Je suis capable de trouver l'emplacement actuel dans le champ de recherche de recherche automatique. Mais je ne peux pas trouver le code postal de ce code. S'il vous plaît donnez-moi une solution.Comment obtenir le code postal de l'emplacement actuel dans iOS en utilisant google api
-(void)googleAPICallWithText:(NSString*)strData {
strData = [strData stringByReplacingOccurrencesOfString:@" " withString:@"+"];
NSLog(@"Value of allSelectedItems = %@", strData);
//google api url
NSString *web_service_URL = [NSString stringWithFormat:@"%@json?input=%@&sensor=%@&key=%@",GOOGLE_GEOLOCATION_URL,strData,@"true",GOOGLE_API_KEY];
NSMutableString *reqData = [NSMutableString stringWithFormat:@""];
id jsonDta= [reqData dataUsingEncoding:NSUTF8StringEncoding];
NSString *jsonRepresantationFormat = [[NSString alloc]initWithData:jsonDta encoding:NSUTF8StringEncoding];
[self WebsewrviceAPICall:web_service_URL webserviceBodyInfo:jsonRepresantationFormat];
}
-(void)WebsewrviceAPICall:(NSString *)serviceURL webserviceBodyInfo:(NSString *)bodyString {
self.connectionTimer = [NSTimer scheduledTimerWithTimeInterval:30.0 target:self selector:@selector(cancelInsingAPICall) userInfo:nil repeats:NO];
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:serviceURL]];
[theRequest setHTTPMethod:@"POST"];
[theRequest setHTTPBody:[bodyString dataUsingEncoding:NSUTF8StringEncoding]];
self.connection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
if(self.connection){
self.receivedData = [NSMutableData data];
}
}