use this below function for getting address for lat long..
-(NSString *)getAddressFromLat:(NSString *)Lati Long:(NSString *)Longi {
NSString *strUrl = [NSString stringWithFormat:@"http://maps.googleapis.com/maps/api/geocode/json?latlng=%@,%@&sensor=true",Lati,Longi];
NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:strUrl]];
NSError *e = nil;
NSMutableArray *json = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&e];
return [[[json valueForKey:@"results"] objectAtIndex:0]valueForKey:@"formatted_address"];
}
pass this function below code:
NSString *strAdd =[self getAddressFromLat:LATITUDE Long:LONGITUDE];
if ([[UIApplication sharedApplication] canOpenURL:
[NSURL URLWithString:@"comgooglemaps://"]]) {
[[UIApplication sharedApplication] openURL:
[NSURL URLWithString:[NSString stringWithFormat:@"comgooglemaps://?q=%@¢er=%@,%@&views=satellite,traffic&zoom=15",[strAdd stringByReplacingOccurrencesOfString:@" " withString:@"+"],LATITUDE,LONGITUDE]];
} else {
NSLog(@"Can't use comgooglemaps://");
}
Above this code great work for me. try this . this will work great..