I would like to know which is best practice for reverse geocoding using Google Maps. I'm consider about API response should be faster and accurate based on the lat and lng for getting the formatted address.
I know these two type methods, in this I want to know which can be more better.
[[GMSGeocoder geocoder] reverseGeocodeCoordinate:CLLocationCoordinate2DMake([strForLatitude floatValue], [strForLongitude floatValue]) completionHandler:
^(GMSReverseGeocodeResponse *response, NSError *error){
ALog(@"Address: %@ ", response.firstResult);
}];
OR
NSError *error = nil;
NSString *lookupString = [NSString stringWithFormat:@"http://maps.googleapis.com/maps/api/geocode/json?latlng=%f,%f&sensor=false",latitude,longitude];
lookupString = [lookupString stringByReplacingOccurrencesOfString:@" " withString:@"+"];
NSData *jsonResponse = [NSData dataWithContentsOfURL:[NSURL URLWithString:lookupString]];
NSDictionary *jsonDict = [NSJSONSerialization JSONObjectWithData:jsonResponse options:kNilOptions error:&error];
NSLog(@"%@",jsonDict);
NSArray* jsonResults = [jsonDict objectForKey:@"results"];
Thanks!