I'm new in iphone development and I want to show the address in mapview. I am currently using CLLocationManager
.
I'm using this method:
-(NSString *)getAddressFromLatLon:(double)pdblLatitude
withLongitude:(double)pdblLongitude
{
NSString *urlString = [NSString stringWithFormat:kGeoCodingString,pdblLatitude, pdblLongitude];
NSError* error;
NSString *locationString = [NSString stringWithContentsOfURL:
[NSURL URLWithString:urlString]
encoding:NSASCIIStringEncoding
error:&error];
locationString = [locationString stringByReplacingOccurrencesOfString:@"\"" withString:@""];
NSLog(@"%@",locationString);
return [locationString substringFromIndex:6];
}
Then I'm passing this values:
[self getAddressFromLatLon:37.484848 withLongitude:74.48489];
However, I do not get my address.