0

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.

Jonathan
  • 20,053
  • 6
  • 63
  • 70
Sonu
  • 937
  • 1
  • 10
  • 39
  • 1. http://stackoverflow.com/questions/2690312/convert-iphone-gps-to-address 2. http://stackoverflow.com/questions/1503100/get-latitude-longitude-from-address 3. http://stackoverflow.com/questions/10413599/get-address-from-latitude-and-longitude-in-ios –  Jun 19 '13 at 07:22
  • @VigneshV http://maps.google.com/maps/api/geocode/json?sensor=false&address=(%0A%20%20%20%20gujarat%0A) i m getting this Url – Sonu Jun 19 '13 at 08:16
  • http://stackoverflow.com/questions/12599316/i-want-to-get-the-location-name-from-the-coordinate-value-in-mapkit-for-iphone i used that code and it works for me but now i think google made changes on google map api as well as its response. – Apple Jun 20 '13 at 09:14

0 Answers0