I already implemented google matching function in my iphone application. It works fine, but if the location to search is the wrong line, it displays the location and redirects it to the current location only after clicking the search button. How to implement this if the location is wrong and then directly go to the current location? My code looks below
NSString *urlString = [[NSString stringWithFormat:@"http://maps.google.com/maps?z=14&q=%@",message] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSURL *url = [NSURL URLWithString:urlString];
if ([[UIApplication sharedApplication] canOpenURL:url]) {
[[UIApplication sharedApplication] openURL:url];
}
please give me a solution as soon as possible thanks in advance
source
share