Use the code below to open the Maps app,
NSString *url; if([[[UIDevice currentDevice] systemVersion] compare:@"6.0" options:NSNumericSearch] == NSOrderedAscending) { url = [NSString stringWithFormat:@"http://maps.google.com/maps?daddr=%@,%@&saddr=%@,%@",[dict objectForKey:@"latitude"],[dict objectForKey:@"longitude"],currentLat,currentLong]; } else { url = [NSString stringWithFormat:@"http://maps.apple.com/maps?daddr=%@,%@&saddr=%@,%@",[dict objectForKey:@"latitude"],[dict objectForKey:@"longitude"],currentLat,currentLong]; } if([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:url]]) { [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]]; }
iOS 6.0 and above has an Apple Map app for the lower version of iOS, you need to open the Google Map app. Here in url,
daddr=%@,%@&saddr=%@,%@
daddr is the destination address, and saddr is the source address.
Ankur source share