Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8590369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:16:44+00:00 2026-06-11T23:16:44+00:00

in my app in ios 5 i have a button name show in map

  • 0

in my app in ios 5 i have a button name show in map

forexample in a store detail view there is a showinmap button and this button goes to maps.google to show the user’s current direction and the store direction and also it draws a line between these direction about how to go there

this was my method:

NSString* url = [NSString stringWithFormat: @"http://maps.google.com/maps?saddr=Current+Location&daddr=%@,%@",lonlocation,latlocation];  

[[UIApplication sharedApplication] openURL: [NSURL URLWithString: url]];                  

but in ios 6 as you know there is no google maps app. instead of that there is apple’s new map app.

now my problem is how can i change my code to do the same job with apple map app in ios6 versions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T23:16:45+00:00Added an answer on June 11, 2026 at 11:16 pm

    Simply replace maps.google.com by maps.apple.com in your URL and it works like a charm 🙂

    CGFloat sysVers = [UIDevice currentDevice].systemVersion.floatValue;
    NSString* hostName = (sysVers < 6.0) ? @"maps.google.com" : @"maps.apple.com";
    
    NSString* url = [NSString stringWithFormat: @"http://%@/maps?saddr=Current+Location&daddr=%@,%@",hostName,lonlocation,latlocation];  
    
    [[UIApplication sharedApplication] openURL: [NSURL URLWithString: url]];                  
    

    [EDIT] As @Vagari pointed out in his answer, it seems that Apple integrated it better than I though and you can point all your URLs to maps.apple.com even in iOS5: Apple will automatically redirect your URLs to maps.google.com if you emit them from a device on iOS5!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ios app that uses the master detail template, the master view
I have an iOS app I created as a view-based app in xCode. I
I have an iOS app and I want to make it accessible. Everything goes
I have a universal iOS app with a custom view that has three buttons,
In my iPhone app, I have this button, that opens a webcal:// URL in
I am using iOS 5 to implement an app. In this app I have
I have a button in my iOS app to share the currently viewed content
I am developing an iOS app . Within this app i have a type
In a Single-View iOS app I'm currently working on, I have a view controller
In my iOS app i have one view controller that handles my main view.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.